aboutsummaryrefslogtreecommitdiffstats
path: root/install.zsh
diff options
context:
space:
mode:
authorLibravatarLarge Libravatar memdmp <memdmpestrogenzone>2025-01-22 18:39:11 +0100
committerLibravatarLarge Libravatar memdmp <memdmpestrogenzone>2025-01-22 18:40:10 +0100
commit1c202b4bb8bc8e1e9a951c3b85101c5c59821896 (patch)
tree764f260f0018b9cbe28f2d57a2d2f41f8315b94c /install.zsh
parent04155f5d1afb2313c57daf98109e20bb6f3e22c9 (diff)
downloadzuwu-1c202b4bb8bc8e1e9a951c3b85101c5c59821896.tar.gz
zuwu-1c202b4bb8bc8e1e9a951c3b85101c5c59821896.tar.bz2
zuwu-1c202b4bb8bc8e1e9a951c3b85101c5c59821896.tar.lz
zuwu-1c202b4bb8bc8e1e9a951c3b85101c5c59821896.zip

fix: use XDG_{CONFIG,DATA}_HOME

Diffstat (limited to 'install.zsh')
-rwxr-xr-xinstall.zsh4
1 files changed, 2 insertions, 2 deletions
diff --git a/install.zsh b/install.zsh
index c493ebd..b7dfec7 100755
--- a/install.zsh
+++ b/install.zsh
@@ -36,7 +36,7 @@ elif [[ "$PREFIX" != "" ]]; then
elif [[ "$(whoami)" == "root" ]]; then
TARGET="/usr/local/share/zsh/plugins/zuwu"
else
- TARGET="$HOME/.local/share/zsh/plugins/zuwu"
+ TARGET="${XDG_DATA_HOME:-"$HOME/.local/share"}/zsh/plugins/zuwu"
fi
mkdir -p "$TARGET"
@@ -64,7 +64,7 @@ fi
# - distribution packaging target
# - local system-wide installation target
# - local per-user installation target
-for d in /usr/share/zsh/plugins/zuwu /usr/local/share/zsh/plugins/zuwu "\\\$HOME/.local/share/zsh/plugins/zuwu"; do
+for d in /usr/share/zsh/plugins/zuwu /usr/local/share/zsh/plugins/zuwu "\\\${XDG_DATA_HOME:-"\\\$HOME/.local/share"}/zsh/plugins/zuwu"; do
if [[ -d "\\\$d" ]]; then
source "\\\$d/zuwu.zsh"
# For debugging, calling _ZUWU_DETECTED_INSTALL_PATH=/dev/null zsh -c 'source ~/.zshrc && echo "\\\$_ZUWU_DETECTED_INSTALL_PATH"' may be useful