1
0
Fork 0
mirror of synced 2024-12-25 23:43:20 -05:00

Don't autoload zimfw if no config file exists

instead of if no ${ZIM_HOME} exists. If current user has no config file,
then most likely they're sourcing the init.zsh generated by another user
in the same machine.
This commit is contained in:
Eric Nielsen 2024-08-16 23:46:32 -05:00
parent 6166fce1a1
commit 7f3491b1bb
No known key found for this signature in database
GPG key ID: 678AF5E338C87D99
2 changed files with 3 additions and 3 deletions

View file

@ -5,7 +5,7 @@ _zimfw_build_init() {
command mv -f ${ztarget}{,.old} || return 1 command mv -f ${ztarget}{,.old} || return 1
fi fi
_zimfw_mv =( _zimfw_mv =(
print -R 'if (( ${+ZIM_HOME} )) zimfw() { source '${${(qqq)__ZIMFW_FILE}/${HOME}/\${HOME}}' "${@}" }' print -R 'if [[ -e ${ZIM_CONFIG_FILE:-<%= home %>/.zimrc} ]] zimfw() { source '${${(qqq)__ZIMFW_FILE}/${HOME}/\${HOME}}' "${@}" }'
local zroot_dir zpre local zroot_dir zpre
local -a zif_functions zif_cmds zroot_functions zroot_cmds local -a zif_functions zif_cmds zroot_functions zroot_cmds
local -a zfunctions=(${_zfunctions}) zcmds=(${_zcmds}) local -a zfunctions=(${_zfunctions}) zcmds=(${_zcmds})

View file

@ -61,7 +61,7 @@ _zimfw_build_init() {
command mv -f ${ztarget}{,.old} || return 1 command mv -f ${ztarget}{,.old} || return 1
fi fi
_zimfw_mv =( _zimfw_mv =(
print -R 'if (( ${+ZIM_HOME} )) zimfw() { source '${${(qqq)__ZIMFW_FILE}/${HOME}/\${HOME}}' "${@}" }' print -R 'if [[ -e ${ZIM_CONFIG_FILE:-${ZDOTDIR:-${HOME}}/.zimrc} ]] zimfw() { source '${${(qqq)__ZIMFW_FILE}/${HOME}/\${HOME}}' "${@}" }'
local zroot_dir zpre local zroot_dir zpre
local -a zif_functions zif_cmds zroot_functions zroot_cmds local -a zif_functions zif_cmds zroot_functions zroot_cmds
local -a zfunctions=(${_zfunctions}) zcmds=(${_zcmds}) local -a zfunctions=(${_zfunctions}) zcmds=(${_zcmds})
@ -462,7 +462,7 @@ _zimfw_compile() {
} }
_zimfw_info() { _zimfw_info() {
print -R 'zimfw version: '${_zversion}' (built at 2024-06-25 17:29:35 UTC, previous commit is 3b7908d)' print -R 'zimfw version: '${_zversion}' (built at 2024-06-25 18:20:18 UTC, previous commit is 6166fce)'
local zparam local zparam
for zparam in LANG ${(Mk)parameters:#LC_*} OSTYPE TERM TERM_PROGRAM TERM_PROGRAM_VERSION ZIM_HOME ZSH_VERSION; do for zparam in LANG ${(Mk)parameters:#LC_*} OSTYPE TERM TERM_PROGRAM TERM_PROGRAM_VERSION ZIM_HOME ZSH_VERSION; do
print -R ${(r.22....:.)zparam}${(P)zparam} print -R ${(r.22....:.)zparam}${(P)zparam}