1
0
Fork 0
mirror of synced 2024-05-27 20:41:11 -04:00
zimfw/src/stage2/50_zimfw_upgrade.zsh.erb
Eric Nielsen 315cd48e73
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.
2019-12-14 22:21:34 -05:00

18 lines
532 B
Plaintext

_zimfw_upgrade() {
local -r ztarget=${ZIM_HOME}/<%= script_filename %>
local -r zurl=https://raw.githubusercontent.com/zimfw/zimfw/develop/<%= script_filename %>
{
if (( ${+commands[wget]} )); then
command wget -nv -O ${ztarget}.new ${zurl} || return 1
else
command curl -fsSL -o ${ztarget}.new ${zurl} || return 1
fi
_zimfw_mv ${ztarget}{.new,} && \
if (( ! _zquiet )); then
print -P '<%= done %>Done with upgrade.'
fi
} always {
command rm -f ${ztarget}.new
}
}