summaryrefslogtreecommitdiff
path: root/oh-my-zsh.sh
diff options
context:
space:
mode:
authorMarc Cornellà <marc.cornella@live.com>2020-09-04 21:50:00 +0200
committerMarc Cornellà <marc.cornella@live.com>2020-09-04 21:50:00 +0200
commit28ee5846bbac56926241fc5ef9f116161ceb6f23 (patch)
treeb338ecb331a096883225caeb4833b381350f2403 /oh-my-zsh.sh
parent87edf16e05598505927410f6b06bbc5a6003805b (diff)
downloadzsh-28ee5846bbac56926241fc5ef9f116161ceb6f23.tar.gz
zsh-28ee5846bbac56926241fc5ef9f116161ceb6f23.tar.bz2
zsh-28ee5846bbac56926241fc5ef9f116161ceb6f23.zip
init: define $ZSH if not defined
Closes #9223
Diffstat (limited to 'oh-my-zsh.sh')
-rw-r--r--oh-my-zsh.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
index 5b057256d..16e244be5 100644
--- a/oh-my-zsh.sh
+++ b/oh-my-zsh.sh
@@ -1,3 +1,6 @@
+# If ZSH is not defined, use the current script's directory.
+[[ -z "$ZSH" ]] && export ZSH="${${(%):-%x}:a:h}"
+
# Set ZSH_CACHE_DIR to the path where cache files should be created
# or else we will use the default cache/
if [[ -z "$ZSH_CACHE_DIR" ]]; then