Last-minute minor fixes:
* Delete .latest_version after upgrading. Having a cache brings in these
  complexities.
* Print warning to stderr, to distinguish it from the normal output.
* Update help to be in sync with the README.md.
This commit is contained in:
Eric Nielsen 2020-01-20 07:03:20 -05:00
parent 64f36feb7f
commit d096b29cac
No known key found for this signature in database
GPG Key ID: 47D1DBFA0765A1FB
6 changed files with 23 additions and 11 deletions

View File

@ -7,9 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
_No unreleased changes._
## [1.1.0] - 2020-01-20
### Added
- `help` and `version` actions.
- `-v` verbose option. Normal mode output is now cleaner and more focused.
- `-v` verbose option. Normal mode output is now focused on the specified action.
- Asynchronously check the latest version every 30 days. This can be disabled
with `zstyle ':zim' disable-version-check yes`.
@ -17,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- When upgrading, download latest release asset instead of raw file from the
master branch.
- `curl` is preferred over `wget`.
(See [#360](https://github.com/zimfw/zimfw/issues/360))
- `wget`'s output is only shown in verbose mode.
## [1.0.1] - 2020-01-09
@ -88,6 +93,7 @@ Take your time to review the updated [README.md] and the changes listed below.
[termtitle]: https://github.com/zimfw/termtitle
[s1ck94]: https://github.com/zimfw/s1ck94
[Unreleased]: https://github.com/zimfw/zimfw/compare/v1.0.1...HEAD
[Unreleased]: https://github.com/zimfw/zimfw/compare/v1.1.0...HEAD
[1.1.0]: https://github.com/zimfw/zimfw/compare/v1.0.1...v1.1.0
[1.0.1]: https://github.com/zimfw/zimfw/compare/v1.0.0...v1.0.1
[1.0.0]: https://github.com/zimfw/zimfw/compare/5d66578...v1.0.0

View File

@ -10,7 +10,7 @@ Startup options:
%B-f%b|%B--fpath%b <path> Add specified path to fpath
%B-a%b|%B--autoload%b <function_name> Autoload specified function
%B-s%b|%B--source%b <file_path> Source specified file
%B-d%b|%B--disabled%b Don't use or uninstall the module
%B-d%b|%B--disabled%b Don't initialize or uninstall the module
"
if [[ ${${funcfiletrace[1]%:*}:t} != .zimrc ]]; then
print -u2 -PR "%F{red}${0}: Must be called from %B<%= home %>/.zimrc%b%f"$'\n\n'${zusage}

View File

@ -10,7 +10,7 @@ _zimfw_version_check() {
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'
print -u2 -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
}

View File

@ -13,7 +13,10 @@ _zimfw_upgrade() {
return 1
fi
fi
_zimfw_mv ${ztarget}{.new,} && _zimfw_print -P '<%= done %>Done with upgrade.'
# .latest_version can be outdated and will yield a false warning if zimfw is
# upgraded before .latest_version is refreshed. Bad thing about having a cache.
_zimfw_mv ${ztarget}{.new,} && command rm -f ${ZIM_HOME}/.latest_version && \
_zimfw_print -P '<%= done %>Done with upgrade.'
} always {
command rm -f ${ztarget}.new
}

View File

@ -6,7 +6,7 @@ class Zim
@home = "${ZDOTDIR:-${HOME}}"
@min_zsh_version = "5.2"
@startup_files_glob = ".z(shenv|profile|shrc|login|logout)"
@version = "1.1.0-SNAPSHOT"
@version = "1.1.0"
@ellipsis = " ..."
@okay = "%F{green})%f "
@error = "x "

View File

@ -112,7 +112,7 @@ Startup options:
%B-f%b|%B--fpath%b <path> Add specified path to fpath
%B-a%b|%B--autoload%b <function_name> Autoload specified function
%B-s%b|%B--source%b <file_path> Source specified file
%B-d%b|%B--disabled%b Don't use or uninstall the module
%B-d%b|%B--disabled%b Don't initialize or uninstall the module
"
if [[ ${${funcfiletrace[1]%:*}:t} != .zimrc ]]; then
print -u2 -PR "%F{red}${0}: Must be called from %B${ZDOTDIR:-${HOME}}/.zimrc%b%f"$'\n\n'${zusage}
@ -248,7 +248,7 @@ _zimfw_version_check() {
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'
print -u2 -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
}
@ -276,7 +276,7 @@ _zimfw_compile() {
}
_zimfw_info() {
print -R 'zimfw version: '${_zversion}' (previous commit is 7fdf65c)'
print -R 'zimfw version: '${_zversion}' (previous commit is 64f36fe)'
print -R 'ZIM_HOME: '${ZIM_HOME}
print -R 'Zsh version: '${ZSH_VERSION}
print -R 'System info: '$(command uname -a)
@ -310,14 +310,17 @@ _zimfw_upgrade() {
return 1
fi
fi
_zimfw_mv ${ztarget}{.new,} && _zimfw_print -P 'Done with upgrade.'
# .latest_version can be outdated and will yield a false warning if zimfw is
# upgraded before .latest_version is refreshed. Bad thing about having a cache.
_zimfw_mv ${ztarget}{.new,} && command rm -f ${ZIM_HOME}/.latest_version && \
_zimfw_print -P 'Done with upgrade.'
} always {
command rm -f ${ztarget}.new
}
}
zimfw() {
local -r _zversion='1.1.0-SNAPSHOT'
local -r _zversion='1.1.0'
local -r zusage="Usage: %B${0}%b <action> [%B-q%b|%B-v%b]
Actions: