1
0
Fork 0
mirror of synced 2024-05-28 13:01:12 -04:00
zimfw/src/stage2/28_zimfw_mv.zsh.erb
Eric Nielsen aade4704b1
Generate login_init.zsh file
So we can have the following code in the zlogin template:

    source ${ZIM_HOME}/login_init.zsh -q &!

instead of depending on the zimfw function there. This allows fixing the
issue were a non-interactive login shell currently yields:

    command not found: zimfw.

To fully fix the issue, we also need a new zshenv template containing:

    ZIM_HOME=${ZDOTDIR:-${HOME}}/.zim

Templates will be updated in the install script.
2020-01-02 12:58:04 -05:00

16 lines
415 B
Plaintext

_zimfw_mv() {
if command cmp -s ${2} ${1}; then
if (( ! _zquiet )); then
print -PR "<%= okay %>%B${2}:%b Already up to date"
fi
else
if [[ -e ${2} ]]; then
command mv -f ${2}{,.old} || return 1
fi
command mv -f ${1} ${2} && \
if (( ! _zquiet )); then
print -PR "<%= okay %>%B${2}:%b Updated. Restart your terminal for changes to take effect."
fi
fi
}