Browse Source

Cancel upgrade if $ZSH is not writable
from #2360

n.st 10 years ago
parent
commit
a9e1d9aa89
1 changed files with 6 additions and 0 deletions
  1. 6 0
      tools/check_for_upgrade.sh

+ 6 - 0
tools/check_for_upgrade.sh

@@ -20,6 +20,12 @@ if [[ -z "$epoch_target" ]]; then
   epoch_target=13
 fi
 
+[ -f ~/.profile ] && source ~/.profile
+
+# Cancel upgrade if the current user doesn't have write permissions for the
+# oh-my-zsh directory.
+[[ -w "$ZSH" ]] || return 0
+
 if [ -f ~/.zsh-update ]
 then
   . ~/.zsh-update