summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorn.st <git@n-st.de>2013-12-18 18:27:20 +0100
committern.st <git@n-st.de>2013-12-18 18:27:20 +0100
commit152e1e07e0397ecc3f1778ea597d081c33ee8ff4 (patch)
tree50f5ce08e096d19c83e1d4aba78283cd383efe2b
parent357ab4912b98e5ffc14dd62a53b988053d7f9a6e (diff)
downloadzsh-152e1e07e0397ecc3f1778ea597d081c33ee8ff4.tar.gz
zsh-152e1e07e0397ecc3f1778ea597d081c33ee8ff4.tar.bz2
zsh-152e1e07e0397ecc3f1778ea597d081c33ee8ff4.zip
Cancel update if the current user doesn't have write permissions for the oh-my-zsh directory.
-rw-r--r--tools/check_for_upgrade.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
index 0f8c9c391..d877e2a89 100644
--- a/tools/check_for_upgrade.sh
+++ b/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