From 9590b96b3f0dc8e2f4a87b632ff59eab28a0081e Mon Sep 17 00:00:00 2001 From: Adam Luikart Date: Mon, 6 Feb 2012 12:22:07 -0600 Subject: Write the update file even if `CLOBBER` is unset. --- tools/check_for_upgrade.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/check_for_upgrade.sh') diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index 0f8c9c391..5c8ce3a50 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -5,7 +5,7 @@ function _current_epoch() { } function _update_zsh_update() { - echo "LAST_EPOCH=$(_current_epoch)" > ~/.zsh-update + echo "LAST_EPOCH=$(_current_epoch)" >! ~/.zsh-update } function _upgrade_zsh() { -- cgit v1.2.3-70-g09d2 From 8d976e02b1da43ec74c1ca6f50584eed566ff73a Mon Sep 17 00:00:00 2001 From: Mark Feltner Date: Tue, 14 Jan 2014 23:13:49 -0600 Subject: fix(tools/check_for_upgrade): Don't source profile Reverts #2296, but mostly #1883. There is no need to source ~/.profile when this script is read. oh-my-zsh writes no configuration data in ~/.profile. If the user wishes to use data within ~/.profile, then they should source it in another place. Fixes #2315 --- tools/check_for_upgrade.sh | 2 -- 1 file changed, 2 deletions(-) (limited to 'tools/check_for_upgrade.sh') diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index 5c8ce3a50..c5fd0cce1 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -20,8 +20,6 @@ if [[ -z "$epoch_target" ]]; then epoch_target=13 fi -[ -f ~/.profile ] && source ~/.profile - if [ -f ~/.zsh-update ] then . ~/.zsh-update -- cgit v1.2.3-70-g09d2 From a9e1d9aa890c18ea3c3250442e7d9de555633237 Mon Sep 17 00:00:00 2001 From: "n.st" Date: Wed, 4 Jun 2014 19:26:46 +0200 Subject: Cancel upgrade if $ZSH is not writable from #2360 --- tools/check_for_upgrade.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools/check_for_upgrade.sh') 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 -- cgit v1.2.3-70-g09d2