fix(updater): address cooldown review feedback

Pass cooldown into upgrade.sh as -c, extract the update helpers, and only
prompt when a cooldown-eligible commit would actually move HEAD.
This commit is contained in:
Robby Russell
2026-09-08 16:11:32 -07:00
parent 84429a7229
commit e872c661ad
4 changed files with 78 additions and 23 deletions
+4 -1
View File
@@ -903,8 +903,11 @@ function _omz::update {
}
# Run update script
local verbose_mode cooldown_days
zstyle -s ':omz:update' verbose verbose_mode || verbose_mode=default
ZSH="$ZSH" command zsh -f "$ZSH/tools/upgrade.sh" -i -v $verbose_mode || return $?
zstyle -s ':omz:update' cooldown cooldown_days || cooldown_days=0
[[ $cooldown_days == <-> ]] || cooldown_days=0
ZSH="$ZSH" command zsh -f "$ZSH/tools/upgrade.sh" -i -v $verbose_mode -c $cooldown_days || return $?
# Update last updated file
zmodload zsh/datetime