1
0
Fork 0
mirror of synced 2024-12-25 07:23:21 -05:00

Reapply "Use ${HOME} in generated static init.zsh script"

This reverts commit 9a47fde0c8.
This commit is contained in:
Eric Nielsen 2024-06-17 07:22:18 -05:00
parent 76164d6217
commit 897afc9cf9
No known key found for this signature in database
GPG key ID: 678AF5E338C87D99
3 changed files with 15 additions and 13 deletions

View file

@ -189,11 +189,11 @@ Per-call initialization options:
shift shift
zarg=${1} zarg=${1}
if [[ ${zarg} != /* ]] zarg=${zroot_dir}/${zarg} if [[ ${zarg} != /* ]] zarg=${zroot_dir}/${zarg}
zcmds+=("source ${(q-)zarg:a}") zcmds+=('source '${(qqq)zarg:a})
;; ;;
-c|--cmd) -c|--cmd)
shift shift
zcmds+=(${1//{}/${(q-)zroot_dir:a}}) zcmds+=(${1//{}/${(qqq)zroot_dir:a}})
;; ;;
-d|--disabled) _zdisabled_root_dirs+=(${zroot_dir}) ;; -d|--disabled) _zdisabled_root_dirs+=(${zroot_dir}) ;;
*) *)
@ -221,11 +221,11 @@ Per-call initialization options:
local -ra prezto_scripts=(${zroot_dir}/init.zsh(N)) local -ra prezto_scripts=(${zroot_dir}/init.zsh(N))
if (( ${#zfpaths} && ${#prezto_scripts} )); then if (( ${#zfpaths} && ${#prezto_scripts} )); then
# this follows the prezto module format, no need to check for other scripts # this follows the prezto module format, no need to check for other scripts
zcmds=('source '${(q-)^prezto_scripts:a}) zcmds=('source '${(qqq)^prezto_scripts:a})
else else
# get script with largest size (descending `O`rder by `L`ength, and return only `[1]` first) # get script with largest size (descending `O`rder by `L`ength, and return only `[1]` first)
local -ra zscripts=(${zroot_dir}/(init.zsh|(${zname:t}|${zroot_dir:t}).(zsh|plugin.zsh|zsh-theme|sh))(NOL[1])) local -ra zscripts=(${zroot_dir}/(init.zsh|(${zname:t}|${zroot_dir:t}).(zsh|plugin.zsh|zsh-theme|sh))(NOL[1]))
zcmds=('source '${(q-)^zscripts:a}) zcmds=('source '${(qqq)^zscripts:a})
fi fi
fi fi
if (( ! ${#zfpaths} && ! ${#zfunctions} && ! ${#zcmds} )); then if (( ! ${#zfpaths} && ! ${#zfunctions} && ! ${#zcmds} )); then
@ -235,6 +235,7 @@ Per-call initialization options:
local -r zpre=${zroot_dir}$'\0' local -r zpre=${zroot_dir}$'\0'
_zfpaths+=(${zpre}${^zfpaths}) _zfpaths+=(${zpre}${^zfpaths})
_zfunctions+=(${zpre}${^zfunctions}) _zfunctions+=(${zpre}${^zfunctions})
zcmds=(${zcmds//${HOME}/\${HOME}})
_zcmds+=(${zpre}${^zcmds}) _zcmds+=(${zpre}${^zcmds})
fi fi
} }

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 "zimfw() { source ${(q-)__ZIMFW_PATH}/zimfw.zsh \"\${@}\" }" print -R 'zimfw() { source '${${(qqq)__ZIMFW_PATH}/${HOME}/\${HOME}}'/zimfw.zsh "${@}" }'
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})
@ -21,7 +21,7 @@ _zimfw_build_init() {
fi fi
done done
zpre=$'*\0' zpre=$'*\0'
if (( ${#_zfpaths} )) print -R 'fpath=('${(q-)${_zfpaths#${~zpre}}:a}' ${fpath})' if (( ${#_zfpaths} )) print -R 'fpath=('${${(qqq)${_zfpaths#${~zpre}}:a}/${HOME}/\${HOME}}' ${fpath})'
if (( ${#zfunctions} )) print -R 'autoload -Uz -- '${zfunctions#${~zpre}} if (( ${#zfunctions} )) print -R 'autoload -Uz -- '${zfunctions#${~zpre}}
for zroot_dir in ${_zroot_dirs}; do for zroot_dir in ${_zroot_dirs}; do
zpre=${zroot_dir}$'\0' zpre=${zroot_dir}$'\0'

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 "zimfw() { source ${(q-)__ZIMFW_PATH}/zimfw.zsh \"\${@}\" }" print -R 'zimfw() { source '${${(qqq)__ZIMFW_PATH}/${HOME}/\${HOME}}'/zimfw.zsh "${@}" }'
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})
@ -77,7 +77,7 @@ _zimfw_build_init() {
fi fi
done done
zpre=$'*\0' zpre=$'*\0'
if (( ${#_zfpaths} )) print -R 'fpath=('${(q-)${_zfpaths#${~zpre}}:a}' ${fpath})' if (( ${#_zfpaths} )) print -R 'fpath=('${${(qqq)${_zfpaths#${~zpre}}:a}/${HOME}/\${HOME}}' ${fpath})'
if (( ${#zfunctions} )) print -R 'autoload -Uz -- '${zfunctions#${~zpre}} if (( ${#zfunctions} )) print -R 'autoload -Uz -- '${zfunctions#${~zpre}}
for zroot_dir in ${_zroot_dirs}; do for zroot_dir in ${_zroot_dirs}; do
zpre=${zroot_dir}$'\0' zpre=${zroot_dir}$'\0'
@ -305,11 +305,11 @@ Per-call initialization options:
shift shift
zarg=${1} zarg=${1}
if [[ ${zarg} != /* ]] zarg=${zroot_dir}/${zarg} if [[ ${zarg} != /* ]] zarg=${zroot_dir}/${zarg}
zcmds+=("source ${(q-)zarg:a}") zcmds+=('source '${(qqq)zarg:a})
;; ;;
-c|--cmd) -c|--cmd)
shift shift
zcmds+=(${1//{}/${(q-)zroot_dir:a}}) zcmds+=(${1//{}/${(qqq)zroot_dir:a}})
;; ;;
-d|--disabled) _zdisabled_root_dirs+=(${zroot_dir}) ;; -d|--disabled) _zdisabled_root_dirs+=(${zroot_dir}) ;;
*) *)
@ -337,11 +337,11 @@ Per-call initialization options:
local -ra prezto_scripts=(${zroot_dir}/init.zsh(N)) local -ra prezto_scripts=(${zroot_dir}/init.zsh(N))
if (( ${#zfpaths} && ${#prezto_scripts} )); then if (( ${#zfpaths} && ${#prezto_scripts} )); then
# this follows the prezto module format, no need to check for other scripts # this follows the prezto module format, no need to check for other scripts
zcmds=('source '${(q-)^prezto_scripts:a}) zcmds=('source '${(qqq)^prezto_scripts:a})
else else
# get script with largest size (descending `O`rder by `L`ength, and return only `[1]` first) # get script with largest size (descending `O`rder by `L`ength, and return only `[1]` first)
local -ra zscripts=(${zroot_dir}/(init.zsh|(${zname:t}|${zroot_dir:t}).(zsh|plugin.zsh|zsh-theme|sh))(NOL[1])) local -ra zscripts=(${zroot_dir}/(init.zsh|(${zname:t}|${zroot_dir:t}).(zsh|plugin.zsh|zsh-theme|sh))(NOL[1]))
zcmds=('source '${(q-)^zscripts:a}) zcmds=('source '${(qqq)^zscripts:a})
fi fi
fi fi
if (( ! ${#zfpaths} && ! ${#zfunctions} && ! ${#zcmds} )); then if (( ! ${#zfpaths} && ! ${#zfunctions} && ! ${#zcmds} )); then
@ -351,6 +351,7 @@ Per-call initialization options:
local -r zpre=${zroot_dir}$'\0' local -r zpre=${zroot_dir}$'\0'
_zfpaths+=(${zpre}${^zfpaths}) _zfpaths+=(${zpre}${^zfpaths})
_zfunctions+=(${zpre}${^zfunctions}) _zfunctions+=(${zpre}${^zfunctions})
zcmds=(${zcmds//${HOME}/\${HOME}})
_zcmds+=(${zpre}${^zcmds}) _zcmds+=(${zpre}${^zcmds})
fi fi
} }
@ -461,7 +462,7 @@ _zimfw_compile() {
} }
_zimfw_info() { _zimfw_info() {
print -R 'zimfw version: '${_zversion}' (built at 2024-06-15 01:16:55 UTC, previous commit is 9a47fde)' print -R 'zimfw version: '${_zversion}' (built at 2024-06-17 12:21:22 UTC, previous commit is 76164d6)'
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}