Luke Granger-Brown
57725ef3ec
git-subtree-dir: third_party/nixpkgs git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
35 lines
654 B
Text
35 lines
654 B
Text
#!@stdenv_shell@ -e
|
|
|
|
export NIXPKGS_DF_EXE="@dfExe@"
|
|
source @dfInit@
|
|
|
|
# If we're switching back from dfhack to vanilla, cleanup all dfhack
|
|
# links so Dwarf Fortress doesn't autoload its leftover libdfhooks.so.
|
|
# Otherwise, populate them.
|
|
dfhack_files=(
|
|
dfhack
|
|
dfhack-run
|
|
.dfhackrc
|
|
libdfhooks.so
|
|
dfhack-config/default
|
|
dfhack-config/init
|
|
hack/*
|
|
stonesense/*
|
|
*.init *.init-example
|
|
)
|
|
|
|
if [ "${NIXPKGS_DF_EXE##*/}" == dfhack ]; then
|
|
for i in "${dfhack_files[@]}"; do
|
|
if [ -e "$i" ]; then
|
|
update_path "$i"
|
|
else
|
|
cleanup_path "$i"
|
|
fi
|
|
done
|
|
else
|
|
for i in "${dfhack_files[@]}"; do
|
|
cleanup_path "$i"
|
|
done
|
|
fi
|
|
|
|
go
|