foxshell/fn/-z4h-ssh-maybe-update
2025-07-04 11:48:40 -05:00

18 lines
411 B
Bash

#!/usr/bin/env zsh
# Requires: [[ $Z4H_SSH == <1->:* ]]
eval "$_z4h_opt"
local min_version=${Z4H_SSH%%:*}
local got_version
got_version=${$(<$Z4H/zsh4humans/version)%$'\r'} &&
[[ $got_version == <-> ]] &&
(( got_version >= min_version )) &&
return
print -Pru2 -- "%F{3}z4h%f: %Binitiating update%b (cached version too old)"
Z4H_SSH=0:${Z4H_SSH#*:}
-z4h-cmd-update