From 70df740f9d25fdb091c6b4cb1f88a0b4d0af4aca Mon Sep 17 00:00:00 2001 From: Will Badart Date: Fri, 28 Oct 2022 17:01:38 +0000 Subject: [PATCH] Check $ZDOTDIR in bootstrap script Zsh looks for .zshrc in $ZDOTDIR, or $HOME if $ZDOTDIR is unset. I doubt non-$HOME $ZDOTDIRs are widespread (I might be the only one I know with one), but it's how zsh's startup is defined, so it can happen. This commit simply adds a check to the `*/zsh` case of `find_shell()` to respect $ZDOTDIR if it is set. --- scripts/bootstrap/bootstrap-haskell | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/bootstrap/bootstrap-haskell b/scripts/bootstrap/bootstrap-haskell index 25ed299..a99fdd3 100755 --- a/scripts/bootstrap/bootstrap-haskell +++ b/scripts/bootstrap/bootstrap-haskell @@ -403,7 +403,11 @@ download_ghcup() { find_shell() { case $SHELL in */zsh) # login shell is zsh - GHCUP_PROFILE_FILE="$HOME/.zshrc" + if [ -n "$ZDOTDIR" ]; then + GHCUP_PROFILE_FILE="$ZDOTDIR/.zshrc" + else + GHCUP_PROFILE_FILE="$HOME/.zshrc" + fi MY_SHELL="zsh" ;; */bash) # login shell is bash GHCUP_PROFILE_FILE="$HOME/.bashrc"