From cb71e4b56546e8213739ce2fd4a8707d7e43036f Mon Sep 17 00:00:00 2001 From: Alexandr Kozlinskiy Date: Sat, 27 Aug 2016 15:14:31 +0200 Subject: [PATCH] store .zsh-update in $ZSH/cache/ --- tools/check_for_upgrade.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index 64fde3330..2ce8368e6 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -1,5 +1,9 @@ #!/usr/bin/env zsh +if [ -z "$ZSH_UPDATE" ]; then + ZSH_UPDATE="$ZSH/cache/.zsh-update" +fi + zmodload zsh/datetime function _current_epoch() { @@ -7,7 +11,7 @@ function _current_epoch() { } function _update_zsh_update() { - echo "LAST_EPOCH=$(_current_epoch)" >! ${ZDOTDIR:-${HOME}}/.zsh-update + echo "LAST_EPOCH=$(_current_epoch)" >! $ZSH_UPDATE } function _upgrade_zsh() { @@ -29,9 +33,9 @@ fi # Cancel upgrade if git is unavailable on the system whence git >/dev/null || return 0 -if [ -f ${ZDOTDIR:-${HOME}}/.zsh-update ] +if [ -f $ZSH_UPDATE ] then - . ${ZDOTDIR:-${HOME}}/.zsh-update + . $ZSH_UPDATE if [[ -z "$LAST_EPOCH" ]]; then _update_zsh_update && return 0;