Browse Source

init: define $ZSH if not defined

Closes #9223
Marc Cornellà 3 years ago
parent
commit
28ee5846bb
1 changed files with 3 additions and 0 deletions
  1. 3 0
      oh-my-zsh.sh

+ 3 - 0
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