diff options
author | n.st <git@n-st.de> | 2014-06-04 19:26:46 +0200 |
---|---|---|
committer | ncanceill <nicolas.canceill@ens-cachan.org> | 2014-06-04 19:37:14 +0200 |
commit | a9e1d9aa890c18ea3c3250442e7d9de555633237 (patch) | |
tree | 3f11ff3f570ac9ce215cc5d2d09800b9a9febc9e /tools/check_for_upgrade.sh | |
parent | de41dee9e462e2a04cbe4658a002812d71f9e3c3 (diff) | |
download | zsh-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.sh | 6 |
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 |