📃 fix(zsh-setup): check if /etc/zsh/zshenv exists (#771)

* 📃 fix(zsh-setup): check if `/etc/zsh/zshenv` exists

* 📃 fix(zsh-setup): create `/env/zsh` dir

Co-authored-by: nnyyxxxx <nnyyxxxx@users.noreply.github.com>

---------

Co-authored-by: nnyyxxxx <nnyyxxxx@users.noreply.github.com>
This commit is contained in:
Adam Perkowski 2024-10-08 23:40:15 +02:00 committed by GitHub
parent e9d2e88bc3
commit 3c40bb9a84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -44,6 +44,7 @@ RPROMPT='%F{15}(%F{166}%D{%H:%M}%F{15})%f'
EOL
# Ensure /etc/zsh/zshenv sets ZDOTDIR to the user's config directory
[ ! -f /etc/zsh/zshenv ] && "$ESCALATION_TOOL" mkdir -p /etc/zsh && "$ESCALATION_TOOL" touch /etc/zsh/zshenv
echo "export ZDOTDIR=\"$HOME/.config/zsh\"" | "$ESCALATION_TOOL" tee -a /etc/zsh/zshenv
}