6129062139
instead of allowing xargs to execute the action with no positional parameters. Also don't try to write to .latest_version if there's no write permission. This is supposed to be a background/optional operation, so we don't want to show an error message in this case. And use Zsh globs instead of find with -exec, and find won't fail if there's an error with the -exec command.
14 lines
415 B
Plaintext
14 lines
415 B
Plaintext
_zimfw_source_zimrc() {
|
|
local -r ztarget=<%= home %>/.zimrc
|
|
local -ri _zprepare_xargs=${1}
|
|
local -i _zfailed=0
|
|
if ! source ${ztarget} || (( _zfailed )); then
|
|
print -u2 -PR "%F{red}<%= failed %>Failed to source %B${ztarget}%b%f"
|
|
return 1
|
|
fi
|
|
if (( _zprepare_xargs && ! ${#_zmodules_xargs} )); then
|
|
print -u2 -PR "%F{red}<%= failed %>No modules defined in %B${ztarget}%b%f"
|
|
return 1
|
|
fi
|
|
}
|