浏览代码

Merge pull request #4505 from arvindch/checked-upgrade

Check for git before trying to upgrade OMZ
Marc Cornellà 9 年之前
父节点
当前提交
b3c10b925e
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      tools/check_for_upgrade.sh

+ 3 - 1
tools/check_for_upgrade.sh

@@ -26,6 +26,9 @@ fi
 # oh-my-zsh directory.
 [[ -w "$ZSH" ]] || return 0
 
+# Cancel upgrade if git is unavailable on the system
+whence git >/dev/null || return 0
+
 if [ -f ~/.zsh-update ]
 then
   . ~/.zsh-update
@@ -54,4 +57,3 @@ else
   # create the zsh file
   _update_zsh_update
 fi
-