c23ab00990c8528a3334d178b9ec9135385cc99f

Author
Marc Cornellà <marc.cornella@live.com>
Committer
GitHub <noreply@github.com>
Date

Message

upgrade: fix lock-out on first upgrade check

This early return made it so the lock wasn't removed, therefore locking out
the upgrade script from ever entering the upgrade routine.

Fixes #6138 

Note: the logic needs some rework.

Diff

 1diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
 2index 05b31e8d42cf4e50e4e4e6a30833bb7922088664..c8dedcf77d0fcfb0ace9c759925ab220fa0b3a64 100644
 3--- a/tools/check_for_upgrade.sh
 4+++ b/tools/check_for_upgrade.sh
 5@@ -34,7 +34,9 @@ if mkdir "$ZSH/log/update.lock" 2>/dev/null; then
 6     . ${ZSH_CACHE_DIR}/.zsh-update
 7 
 8     if [[ -z "$LAST_EPOCH" ]]; then
 9-      _update_zsh_update && return 0
10+      _update_zsh_update
11+      rmdir $ZSH/log/update.lock # TODO: fix later
12+      return 0
13     fi
14 
15     epoch_diff=$(($(_current_epoch) - $LAST_EPOCH))