mirror of
https://github.com/atuinsh/atuin.git
synced 2024-11-22 08:13:57 +01:00
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>
This commit is contained in:
parent
de6221942a
commit
bdd7fe661f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user