From d096b29caca6df8e16985037126bb5c49009b98a Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Mon, 20 Jan 2020 07:03:20 -0500 Subject: [PATCH] v1.1.0 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. --- CHANGELOG.md | 10 ++++++++-- src/stage2/30_zmodule.zsh.erb | 2 +- src/stage2/40_zimfw_version_check.zsh.erb | 2 +- src/stage2/50_zimfw_upgrade.zsh.erb | 5 ++++- src/zimfw.zsh.erb | 2 +- zimfw.zsh | 13 ++++++++----- 6 files changed, 23 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d40a71..f93c852 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/stage2/30_zmodule.zsh.erb b/src/stage2/30_zmodule.zsh.erb index 3e144eb..ecfa1c2 100644 --- a/src/stage2/30_zmodule.zsh.erb +++ b/src/stage2/30_zmodule.zsh.erb @@ -10,7 +10,7 @@ Startup options: %B-f%b|%B--fpath%b Add specified path to fpath %B-a%b|%B--autoload%b Autoload specified function %B-s%b|%B--source%b 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} diff --git a/src/stage2/40_zimfw_version_check.zsh.erb b/src/stage2/40_zimfw_version_check.zsh.erb index 90b4113..94802b8 100644 --- a/src/stage2/40_zimfw_version_check.zsh.erb +++ b/src/stage2/40_zimfw_version_check.zsh.erb @@ -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 } diff --git a/src/stage2/50_zimfw_upgrade.zsh.erb b/src/stage2/50_zimfw_upgrade.zsh.erb index ada08cd..21d0205 100644 --- a/src/stage2/50_zimfw_upgrade.zsh.erb +++ b/src/stage2/50_zimfw_upgrade.zsh.erb @@ -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 } diff --git a/src/zimfw.zsh.erb b/src/zimfw.zsh.erb index 7ca5604..1f9ac8e 100644 --- a/src/zimfw.zsh.erb +++ b/src/zimfw.zsh.erb @@ -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 " diff --git a/zimfw.zsh b/zimfw.zsh index 264f078..fa9b9f8 100644 --- a/zimfw.zsh +++ b/zimfw.zsh @@ -112,7 +112,7 @@ Startup options: %B-f%b|%B--fpath%b Add specified path to fpath %B-a%b|%B--autoload%b Autoload specified function %B-s%b|%B--source%b 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 [%B-q%b|%B-v%b] Actions: