zimfw/src/stage2/29_zimfw_build_init.zsh.erb

14 lines
483 B
Plaintext

_zimfw_build_init() {
local -r ztarget=${ZIM_HOME}/init.zsh
# Force update of 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 -R "zimfw() { source ${ZIM_HOME}/zimfw.zsh \"\${@}\" }"
if (( ${#_zfpaths} )) print -R 'fpath=('${_zfpaths:A}' ${fpath})'
if (( ${#_zfunctions} )) print -R 'autoload -Uz '${_zfunctions}
print -R ${(F)_zcmds}
) ${ztarget}
}