Browse Source

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

n.st 11 years ago
parent
commit
152e1e07e0
1 changed files with 7 additions and 0 deletions
  1. 7 0
      tools/check_for_upgrade.sh

+ 7 - 0
tools/check_for_upgrade.sh

@@ -26,6 +26,13 @@ if [ -f ~/.zsh-update ]
 then
   . ~/.zsh-update
 
+  # cancel update if the current user doesn't have write permissions for the
+  # oh-my-zsh directory
+  if [ -n $(find -not -writable "$ZSH") ]
+  then
+    return 0;
+  fi
+
   if [[ -z "$LAST_EPOCH" ]]; then
     _update_zsh_update && return 0;
   fi