1
0
Fork 0
mirror of synced 2024-05-27 12:31:12 -04:00
zimfw/src/stage2/31_zimfw_source_zimrc.zsh.erb
Eric Nielsen 7d43589843
Add zstyle to set default zmodule tool
and also simplify code by setting multiple variables at once. This
should make the resulting script a tiny bit smaller, while not
compromising on legibility.
2021-07-11 15:58:15 -05:00

13 lines
409 B
Plaintext

_zimfw_source_zimrc() {
local -r ztarget=<%= home %>/.zimrc _zargs_action=${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 [[ -n ${_zargs_action} && ${#_zmodules_zargs} -eq 0 ]]; then
print -u2 -PR "%F{red}<%= failed %>No modules defined in %B${ztarget}%b%f"
return 1
fi
}