mirror of https://github.com/zimfw/zimfw.git
every 30 days, storing it in a .latest_version file. Also allow disabling this with: zstyle ':zim' disable-version-check yespull/370/head
parent
7fdf65c58f
commit
1341afe525
@ -0,0 +1,16 @@ |
||||
_zimfw_version_check() { |
||||
if (( _zprintlevel > 0 )); then |
||||
setopt LOCAL_OPTIONS EXTENDED_GLOB |
||||
local -r ztarget=${ZIM_HOME}/.latest_version |
||||
# If .latest_version does not exist or was not modified in the last 30 days |
||||
if [[ ! -f ${ztarget}(#qNm-30) ]]; then |
||||
command git ls-remote --tags --refs https://github.com/zimfw/zimfw.git 'v*' | \ |
||||
command sed 's?^.*/v??' | command sort -n -t. -k1,1 -k2,2 -k3,3 | \ |
||||
command tail -n1 >! ${ztarget} &! |
||||
fi |
||||
local -r zlatest_version=$(<${ztarget}) |
||||
if [[ -n ${zlatest_version} && ${_zversion} != ${zlatest_version} ]]; then |
||||
print -PR "%F{yellow}Latest zimfw version is %B${zlatest_version}%b. You're using version %B${_zversion}%b. Run %Bzimfw upgrade%b to upgrade.%f"$'\n' |
||||
fi |
||||
fi |
||||
} |
@ -1,6 +1,6 @@ |
||||
_zimfw_info() { |
||||
print -R 'Zim version: '${_zversion}' (previous commit is <%= `git rev-parse --short HEAD | tr -d '\r\n'` %>)' |
||||
print -R 'ZIM_HOME: '${ZIM_HOME} |
||||
print -R 'Zsh version: '${ZSH_VERSION} |
||||
print -R 'System info: '$(command uname -a) |
||||
print -R 'zimfw version: '${_zversion}' (previous commit is <%= `git rev-parse --short HEAD | tr -d '\r\n'` %>)' |
||||
print -R 'ZIM_HOME: '${ZIM_HOME} |
||||
print -R 'Zsh version: '${ZSH_VERSION} |
||||
print -R 'System info: '$(command uname -a) |
||||
} |
||||
|
Loading…
Reference in new issue