···01shopt -s extglob
23[ -z "$DF_DIR" ] && export DF_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/df_linux"
···7update_path() {
8 local path="$1"
910- mkdir -p "$DF_DIR/$(dirname "$path")"
11 # If user has replaced these data directories, let them stay.
12 if [ ! -e "$DF_DIR/$path" ] || [ -L "$DF_DIR/$path" ]; then
13- rm -f "$DF_DIR/$path"
14- ln -s "$env_dir/$path" "$DF_DIR/$path"
15 fi
16}
1718forcecopy_path() {
19 local path="$1"
2021- mkdir -p "$DF_DIR/$(dirname "$path")"
22- rm -rf "$DF_DIR/$path"
23- cp -rL --no-preserve=all "$env_dir/$path" "$DF_DIR/$path"
24}
2526-mkdir -p "$DF_DIR"
2728-cat <<EOF >&2
29Using $DF_DIR as Dwarf Fortress overlay directory.
30If you do any changes in it, don't forget to clean it when updating the game version!
31We try to detect changes based on data directories being symbolic links -- keep this in mind.
···1+#!@stdenv_shell@ -e
2shopt -s extglob
34[ -z "$DF_DIR" ] && export DF_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/df_linux"
···8update_path() {
9 local path="$1"
1011+ @mkdir@ -p "$DF_DIR/$(dirname "$path")"
12 # If user has replaced these data directories, let them stay.
13 if [ ! -e "$DF_DIR/$path" ] || [ -L "$DF_DIR/$path" ]; then
14+ @rm@ -f "$DF_DIR/$path"
15+ @ln@ -s "$env_dir/$path" "$DF_DIR/$path"
16 fi
17}
1819forcecopy_path() {
20 local path="$1"
2122+ @mkdir@ -p "$DF_DIR/$(dirname "$path")"
23+ @rm@ -rf "$DF_DIR/$path"
24+ @cp@ -rL --no-preserve=all "$env_dir/$path" "$DF_DIR/$path"
25}
2627+@mkdir@ -p "$DF_DIR"
2829+@cat@ <<EOF >&2
30Using $DF_DIR as Dwarf Fortress overlay directory.
31If you do any changes in it, don't forget to clean it when updating the game version!
32We try to detect changes based on data directories being symbolic links -- keep this in mind.