Skip to content

Commit

Permalink
fix: Ignore errors if cp cannot copy .zwc files
Browse files Browse the repository at this point in the history
This would otherwise bubble up as a hook failure and further up as a zinit call failure
  • Loading branch information
jankatins committed May 3, 2022
1 parent bdd74a6 commit bf71515
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion zinit-install.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -2267,18 +2267,23 @@ zimv() {

@zinit-substitute from to

local -a afr
local -a afr retval
( () { setopt localoptions noautopushd; builtin cd -q "$dir"; } || return 1
afr=( ${~from}(DN) )
if (( ${#afr} )) {
if (( !OPTS[opt_-q,--quiet] )) {
command cp -vf "${afr[1]}" "$to"
retval=$?
# ignore errors if no compiled file is found
command cp -vf "${afr[1]}".zwc "$to".zwc 2>/dev/null
} else {
command cp -f "${afr[1]}" "$to"
retval=$?
# ignore errors if no compiled file is found
command cp -f "${afr[1]}".zwc "$to".zwc 2>/dev/null
}
}
return $retval
)
}
# ]]]
Expand Down

0 comments on commit bf71515

Please sign in to comment.