summaryrefslogtreecommitdiff
path: root/tools/check_for_upgrade.sh
diff options
context:
space:
mode:
authorn.st <git@n-st.de>2014-06-04 19:26:46 +0200
committerncanceill <nicolas.canceill@ens-cachan.org>2014-06-04 19:37:14 +0200
commita9e1d9aa890c18ea3c3250442e7d9de555633237 (patch)
tree3f11ff3f570ac9ce215cc5d2d09800b9a9febc9e /tools/check_for_upgrade.sh
parentde41dee9e462e2a04cbe4658a002812d71f9e3c3 (diff)
downloadzsh-a9e1d9aa890c18ea3c3250442e7d9de555633237.tar.gz
zsh-a9e1d9aa890c18ea3c3250442e7d9de555633237.tar.bz2
zsh-a9e1d9aa890c18ea3c3250442e7d9de555633237.zip
Cancel upgrade if $ZSH is not writable
from #2360
Diffstat (limited to 'tools/check_for_upgrade.sh')
-rw-r--r--tools/check_for_upgrade.sh6
1 files changed, 6 insertions, 0 deletions
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