summaryrefslogtreecommitdiff
path: root/tools/install.sh
diff options
context:
space:
mode:
authorMarc Cornellà <marc@mcornella.com>2023-12-01 17:03:15 +0100
committerMarc Cornellà <marc@mcornella.com>2023-12-01 17:03:15 +0100
commitb6afbbea3a6f41e4016e967da57b33872aff9944 (patch)
tree207d3bf5e06f5bce1a569fb34cbad0bda5b1e356 /tools/install.sh
parent9b5b389c22396552086480474c108380817a44a7 (diff)
downloadzsh-b6afbbea3a6f41e4016e967da57b33872aff9944.tar.gz
zsh-b6afbbea3a6f41e4016e967da57b33872aff9944.tar.bz2
zsh-b6afbbea3a6f41e4016e967da57b33872aff9944.zip
fix(installer): fix path logic and improve clarity on ZDOTDIR use
Diffstat (limited to 'tools/install.sh')
-rwxr-xr-xtools/install.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/install.sh b/tools/install.sh
index fcfbcf778..508fc2f77 100755
--- a/tools/install.sh
+++ b/tools/install.sh
@@ -63,7 +63,9 @@ zdot="${ZDOTDIR:-$HOME}"
# Default value for $ZSH
# a) if $ZDOTDIR is supplied and not $HOME: $ZDOTDIR/ohmyzsh
# b) otherwise, $HOME/.oh-my-zsh
-[ "$ZDOTDIR" = "$HOME" ] || ZSH="${ZSH:-${ZDOTDIR:+$ZDOTDIR/ohmyzsh}}"
+if [ -n "$ZDOTDIR" ] && [ "$ZDOTDIR" != "$HOME" ]; then
+ ZSH="${ZSH:-$ZDOTDIR/ohmyzsh}"
+fi
ZSH="${ZSH:-$HOME/.oh-my-zsh}"
# Default settings