diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index b42b87750..20ce3464b 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -1,5 +1,7 @@ #!/usr/bin/env zsh +ZSH_UPDATE="$ZSH/cache/.zsh-update" + zmodload zsh/datetime function _current_epoch() { @@ -7,7 +9,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() { @@ -30,8 +32,8 @@ fi whence git >/dev/null || return 0 if mkdir "$ZSH/log/update.lock" 2>/dev/null; then - if [ -f ~/.zsh-update ]; then - . ~/.zsh-update + if [ -f "$ZSH_UPDATE" ]; then + . "$ZSH_UPDATE" if [[ -z "$LAST_EPOCH" ]]; then _update_zsh_update && return 0;