From dfbe535430271c5ee0bbd7cfac6df42222e8cdf0 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Mon, 23 Nov 2020 09:38:08 -0500 Subject: [PATCH] Also force update login_init.zsh as we do for init.zsh, so behavior is symmetric. This guarantees that both init.zsh and login_init.zsh will always have newer timestamps than .zimrc after a build. --- src/stage2/29_zimfw_build_login_init.zsh.erb | 4 ++++ zimfw.zsh | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/stage2/29_zimfw_build_login_init.zsh.erb b/src/stage2/29_zimfw_build_login_init.zsh.erb index ee93df2..600a5a7 100644 --- a/src/stage2/29_zimfw_build_login_init.zsh.erb +++ b/src/stage2/29_zimfw_build_login_init.zsh.erb @@ -3,6 +3,10 @@ _zimfw_build_login_init() { local -Ur zscriptdirs=(${ZIM_HOME} ${${_zdirs##${ZIM_HOME}/*}:A}) local -r zscriptglob=("${^zscriptdirs[@]}/(^*test*/)#*.zsh(|-theme)(N-.)") local -r 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} diff --git a/zimfw.zsh b/zimfw.zsh index 231a6d4..2375637 100644 --- a/zimfw.zsh +++ b/zimfw.zsh @@ -69,6 +69,10 @@ _zimfw_build_login_init() { local -Ur zscriptdirs=(${ZIM_HOME} ${${_zdirs##${ZIM_HOME}/*}:A}) local -r zscriptglob=("${^zscriptdirs[@]}/(^*test*/)#*.zsh(|-theme)(N-.)") local -r ztarget=${ZIM_HOME}/login_init.zsh + # Force update of login_init.zsh if it's older than .zimrc + if [[ ${ztarget} -ot ${ZDOTDIR:-${HOME}}/.zimrc ]]; then + command mv -f ${ztarget}{,.old} || return 1 + fi _zimfw_mv =( print -Rn "() { setopt LOCAL_OPTIONS CASE_GLOB EXTENDED_GLOB @@ -315,7 +319,7 @@ _zimfw_compile() { } _zimfw_info() { - print -R 'zimfw version: '${_zversion}' (previous commit is 78b4711)' + print -R 'zimfw version: '${_zversion}' (previous commit is c6f0720)' print -R 'ZIM_HOME: '${ZIM_HOME} print -R 'Zsh version: '${ZSH_VERSION} print -R 'System info: '$(command uname -a)