diff options
author | Dennis Trautwein <dennis.trautwein@posteo.de> | 2023-12-09 18:52:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-09 17:52:09 +0000 |
commit | bdd7fe661f5157dd30bb0dd07006bfa97555b8f6 (patch) | |
tree | 61308378dcad9c008ed5e34a50c9dc87adde6b29 | |
parent | de6221942ad8b1a6ce2a81aaf878e37a48ccb0ab (diff) |
fix: respect ZSH's $ZDOTDIR environment variable (#942)
ZSH reads its configuration by default relative to a path that's set via $ZDOTDIR. If $ZDOTDIR is not set, then the value of $HOME is used; this is the usual case. Source: https://zsh.sourceforge.io/Intro/intro_3.html#IDX11
Also $HOME is save to use, because "The system shall initialize this variable at the time of login to be a pathname of the user's home directory". Source: https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html
Lastly, the shell parameter expansion syntax is save to use generically: https://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_02
Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
-rwxr-xr-x | install.sh | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -184,7 +184,7 @@ esac # Use of single quotes around $() is intentional here # shellcheck disable=SC2016 if ! grep -q "atuin init zsh" ~/.zshrc; then - printf '\neval "$(atuin init zsh)"\n' >> ~/.zshrc + printf '\neval "$(atuin init zsh)"\n' >> "${ZDOTDIR:-$HOME}/.zshrc" fi # Use of single quotes around $() is intentional here |