1
0
Fork 0
mirror of synced 2024-05-25 11:31:14 -04:00
zimfw/src/stage2/29_zimfw_build_login_init.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
563 B
Plaintext

_zimfw_build_login_init() {
# Array with unique dirs. ${ZIM_HOME} or any subdirectory should only occur once.
local -Ur zscriptdirs=(${ZIM_HOME} ${${_zdirs##${ZIM_HOME}/*}:A})
local -r zscriptglob=("${^zscriptdirs[@]}/(^*test*/)#*.zsh(|-theme)(N-.)") ztarget=${ZIM_HOME}/login_init.zsh
# Force update of login_init.zsh if it's older than .zimrc
if [[ ${ztarget} -ot <%= home %>/.zimrc ]]; then
command mv -f ${ztarget}{,.old} || return 1
fi
_zimfw_mv =(
print -Rn "<%= render_escaped("src/templates/login_init.zsh.erb") %>"
) ${ztarget}
}