mirror of https://github.com/zimfw/zimfw.git
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.pull/370/head
parent
cbf142a988
commit
6129062139
@ -1,8 +1,13 @@ |
||||
_zimfw_source_zimrc() { |
||||
local -r ztarget=<%= home %>/.zimrc |
||||
local -ri _zprepare_xargs=${1} |
||||
local -i _zfailed=0 |
||||
if ! source <%= home %>/.zimrc || (( _zfailed )); then |
||||
print -u2 -PR "%F{red}<%= failed %>Failed to source %B<%= home %>/.zimrc%b%f" |
||||
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 |
||||
} |
||||
|
@ -1,7 +1,7 @@ |
||||
_zimfw_clean_compiled() { |
||||
local zopt |
||||
(( _zprintlevel > 0 )) && zopt='-v' |
||||
command find ${ZIM_HOME} \( -name '*.zwc' -o -name '*.zwc.old' \) -exec rm -f ${zopt} {} \; || return 1 |
||||
command rm -f ${zopt} ${ZIM_HOME}/**/*.zwc(|.old) || return 1 |
||||
command rm -f ${zopt} <%= home %>/<%= startup_files_glob %>.zwc(|.old)(N) || return 1 |
||||
_zimfw_print -P '<%= done %>Done with clean-compiled. Run %Bzimfw compile%b to re-compile.' |
||||
} |
||||
|
Loading…
Reference in new issue