From 28e434565376e600f2331a972eaa20e0ffb6ee90 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Thu, 9 Jan 2020 07:21:16 -0500 Subject: [PATCH] Fix zimfw clean-dumpfile when there's no matches It fails with _zimfw_clean_dumpfile:4: no matches found: /path/to/.zcompdump(|.zwc(|.old)) --- CHANGELOG.md | 1 + src/stage2/50_zimfw_clean_dumpfile.zsh.erb | 2 +- zimfw.zsh | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8d0580..40bd5eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Zsh 5.2 does not recognize the `:P` modifier. Replace it by `:A`. - Also compile and clean .zprofile among the startup files. +- Don't fail on `zimfw clean-dumpfile` when there's nothing to remove. ## [1.0.0] - 2020-01-07 diff --git a/src/stage2/50_zimfw_clean_dumpfile.zsh.erb b/src/stage2/50_zimfw_clean_dumpfile.zsh.erb index 909628e..c6b307b 100644 --- a/src/stage2/50_zimfw_clean_dumpfile.zsh.erb +++ b/src/stage2/50_zimfw_clean_dumpfile.zsh.erb @@ -2,6 +2,6 @@ _zimfw_clean_dumpfile() { local zdumpfile zopt zstyle -s ':zim:completion' dumpfile 'zdumpfile' || zdumpfile=<%= home %>/.zcompdump (( ! _zquiet )) && zopt='-v' - command rm -f ${zopt} ${zdumpfile}(|.zwc(|.old)) || return 1 + command rm -f ${zopt} ${zdumpfile}(|.zwc(|.old))(N) || return 1 _zimfw_print -P '<%= done %>Done with clean-dumpfile. Restart your terminal to dump an updated configuration.' } diff --git a/zimfw.zsh b/zimfw.zsh index 2dedb88..3c58fce 100644 --- a/zimfw.zsh +++ b/zimfw.zsh @@ -249,7 +249,7 @@ _zimfw_clean_dumpfile() { local zdumpfile zopt zstyle -s ':zim:completion' dumpfile 'zdumpfile' || zdumpfile=${ZDOTDIR:-${HOME}}/.zcompdump (( ! _zquiet )) && zopt='-v' - command rm -f ${zopt} ${zdumpfile}(|.zwc(|.old)) || return 1 + command rm -f ${zopt} ${zdumpfile}(|.zwc(|.old))(N) || return 1 _zimfw_print -P 'Done with clean-dumpfile. Restart your terminal to dump an updated configuration.' } @@ -258,7 +258,7 @@ _zimfw_compile() { } _zimfw_info() { - print 'Zim version: 1.0.1-SNAPSHOT (previous commit is 2cc69d5)' + print 'Zim version: 1.0.1-SNAPSHOT (previous commit is 424526e)' print -R 'ZIM_HOME: '${ZIM_HOME} print -R 'Zsh version: '${ZSH_VERSION} print -R 'System info: '$(command uname -a)