浏览代码

init: define $ZSH if not defined

Closes #9223
Marc Cornellà 3 年之前
父节点
当前提交
28ee5846bb
共有 1 个文件被更改,包括 3 次插入0 次删除
  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