b6afbbea3a6f41e4016e967da57b33872aff9944

Author
Marc Cornellà <marc@mcornella.com>
Committer
Marc Cornellà <marc@mcornella.com>
Date

Message

fix(installer): fix path logic and improve clarity on ZDOTDIR use

Diff

 1diff --git a/tools/install.sh b/tools/install.sh
 2index fcfbcf778f68e70230cd4b876542d5bfc96a0906..508fc2f7739fa635889f269ce4c2bfd343aa10cf 100755
 3--- a/tools/install.sh
 4+++ b/tools/install.sh
 5@@ -63,7 +63,9 @@ zdot="${ZDOTDIR:-$HOME}"
 6 # Default value for $ZSH
 7 # a) if $ZDOTDIR is supplied and not $HOME: $ZDOTDIR/ohmyzsh
 8 # b) otherwise, $HOME/.oh-my-zsh
 9-[ "$ZDOTDIR" = "$HOME" ] || ZSH="${ZSH:-${ZDOTDIR:+$ZDOTDIR/ohmyzsh}}"
10+if [ -n "$ZDOTDIR" ] && [ "$ZDOTDIR" != "$HOME" ]; then
11+  ZSH="${ZSH:-$ZDOTDIR/ohmyzsh}"
12+fi
13 ZSH="${ZSH:-$HOME/.oh-my-zsh}"
14 
15 # Default settings