From a9e1d9aa890c18ea3c3250442e7d9de555633237 Mon Sep 17 00:00:00 2001 From: "n.st" Date: Wed, 4 Jun 2014 19:26:46 +0200 Subject: [PATCH] Cancel upgrade if $ZSH is not writable from #2360 --- tools/check_for_upgrade.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index c5fd0cce1..8b8ecae03 100644 --- a/tools/check_for_upgrade.sh +++ b/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