c9e5adb637c0220a471c2ec4f0fb0f4195fcfb35

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #2358 from n-st/master

Cancel update if the current user doesn't have write permissions for the oh-my-zsh directory.

Diff

 1diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
 2index 0f8c9c391413e460fd99d80a50c5fb6b1e5c0984..d877e2a892c4b320f8cf3871d752190c26141073 100644
 3--- a/tools/check_for_upgrade.sh
 4+++ b/tools/check_for_upgrade.sh
 5@@ -26,6 +26,13 @@ if [ -f ~/.zsh-update ]
 6 then
 7   . ~/.zsh-update
 8 
 9+  # cancel update if the current user doesn't have write permissions for the
10+  # oh-my-zsh directory
11+  if [ -n $(find -not -writable "$ZSH") ]
12+  then
13+    return 0;
14+  fi
15+
16   if [[ -z "$LAST_EPOCH" ]]; then
17     _update_zsh_update && return 0;
18   fi