Don't resolve symlinks when building init.zsh
So init.zsh is consistent after symlinks change to point to something else. See zimfw/completion#15
This commit is contained in:
parent
ee93f7944f
commit
67de6ec25b
5 changed files with 15 additions and 15 deletions
|
@ -5,4 +5,4 @@ fi
|
|||
autoload -Uz zargs
|
||||
|
||||
# Define Zim location
|
||||
if (( ! ${+ZIM_HOME} )) typeset -g ZIM_HOME=${0:A:h}
|
||||
if (( ! ${+ZIM_HOME} )) typeset -g ZIM_HOME=${0:h}
|
||||
|
|
|
@ -22,7 +22,7 @@ _zimfw_build_init() {
|
|||
fi
|
||||
done
|
||||
zpre=$'*\0'
|
||||
if (( ${#_zfpaths} )) print 'fpath=('${(q-)${_zfpaths#${~zpre}}:A}' ${fpath})'
|
||||
if (( ${#_zfpaths} )) print 'fpath=('${(q-)${_zfpaths#${~zpre}}:a}' ${fpath})'
|
||||
if (( ${#zfunctions} )) print -R 'autoload -Uz -- '${zfunctions#${~zpre}}
|
||||
for zroot_dir in ${_zroot_dirs}; do
|
||||
zpre=${zroot_dir}$'\0'
|
||||
|
|
|
@ -179,11 +179,11 @@ Per-call initialization options:
|
|||
shift
|
||||
zarg=${1}
|
||||
if [[ ${zarg} != /* ]] zarg=${zroot_dir}/${zarg}
|
||||
zcmds+=("source ${(q-)zarg:A}")
|
||||
zcmds+=("source ${(q-)zarg:a}")
|
||||
;;
|
||||
-c|--cmd)
|
||||
shift
|
||||
zcmds+=(${1//{}/${(q-)zroot_dir:A}})
|
||||
zcmds+=(${1//{}/${(q-)zroot_dir:a}})
|
||||
;;
|
||||
-d|--disabled) _zdisabled_root_dirs+=(${zroot_dir}) ;;
|
||||
*)
|
||||
|
@ -211,11 +211,11 @@ Per-call initialization options:
|
|||
local -ra prezto_scripts=(${zroot_dir}/init.zsh(N))
|
||||
if (( ${#zfpaths} && ${#prezto_scripts} )); then
|
||||
# this follows the prezto module format, no need to check for other scripts
|
||||
zcmds=('source '${(q-)^prezto_scripts:A})
|
||||
zcmds=('source '${(q-)^prezto_scripts:a})
|
||||
else
|
||||
# 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]))
|
||||
zcmds=('source '${(q-)^zscripts:A})
|
||||
zcmds=('source '${(q-)^zscripts:a})
|
||||
fi
|
||||
fi
|
||||
if (( ! ${#zfpaths} && ! ${#zfunctions} && ! ${#zcmds} )); then
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
_zimfw_clean_compiled() {
|
||||
# Array with unique dirs. ${ZIM_HOME} or any subdirectory should only occur once.
|
||||
local -Ur zscriptdirs=(${ZIM_HOME} ${${(v)_zdirs##${ZIM_HOME}/*}:A})
|
||||
local -Ur zscriptdirs=(${ZIM_HOME:A} ${${(v)_zdirs##${ZIM_HOME:A}/*}:A})
|
||||
local zopt
|
||||
if (( _zprintlevel > 0 )) zopt=-v
|
||||
command rm -f ${zopt} ${^zscriptdirs}/**/*.zwc(|.old)(N) && \
|
||||
|
|
16
zimfw.zsh
16
zimfw.zsh
|
@ -31,7 +31,7 @@ fi
|
|||
autoload -Uz zargs
|
||||
|
||||
# Define Zim location
|
||||
if (( ! ${+ZIM_HOME} )) typeset -g ZIM_HOME=${0:A:h}
|
||||
if (( ! ${+ZIM_HOME} )) typeset -g ZIM_HOME=${0:h}
|
||||
|
||||
_zimfw_print() {
|
||||
if (( _zprintlevel > 0 )) print "${@}"
|
||||
|
@ -74,7 +74,7 @@ _zimfw_build_init() {
|
|||
fi
|
||||
done
|
||||
zpre=$'*\0'
|
||||
if (( ${#_zfpaths} )) print 'fpath=('${(q-)${_zfpaths#${~zpre}}:A}' ${fpath})'
|
||||
if (( ${#_zfpaths} )) print 'fpath=('${(q-)${_zfpaths#${~zpre}}:a}' ${fpath})'
|
||||
if (( ${#zfunctions} )) print -R 'autoload -Uz -- '${zfunctions#${~zpre}}
|
||||
for zroot_dir in ${_zroot_dirs}; do
|
||||
zpre=${zroot_dir}$'\0'
|
||||
|
@ -291,11 +291,11 @@ Per-call initialization options:
|
|||
shift
|
||||
zarg=${1}
|
||||
if [[ ${zarg} != /* ]] zarg=${zroot_dir}/${zarg}
|
||||
zcmds+=("source ${(q-)zarg:A}")
|
||||
zcmds+=("source ${(q-)zarg:a}")
|
||||
;;
|
||||
-c|--cmd)
|
||||
shift
|
||||
zcmds+=(${1//{}/${(q-)zroot_dir:A}})
|
||||
zcmds+=(${1//{}/${(q-)zroot_dir:a}})
|
||||
;;
|
||||
-d|--disabled) _zdisabled_root_dirs+=(${zroot_dir}) ;;
|
||||
*)
|
||||
|
@ -323,11 +323,11 @@ Per-call initialization options:
|
|||
local -ra prezto_scripts=(${zroot_dir}/init.zsh(N))
|
||||
if (( ${#zfpaths} && ${#prezto_scripts} )); then
|
||||
# this follows the prezto module format, no need to check for other scripts
|
||||
zcmds=('source '${(q-)^prezto_scripts:A})
|
||||
zcmds=('source '${(q-)^prezto_scripts:a})
|
||||
else
|
||||
# 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]))
|
||||
zcmds=('source '${(q-)^zscripts:A})
|
||||
zcmds=('source '${(q-)^zscripts:a})
|
||||
fi
|
||||
fi
|
||||
if (( ! ${#zfpaths} && ! ${#zfunctions} && ! ${#zcmds} )); then
|
||||
|
@ -404,7 +404,7 @@ _zimfw_check_version() {
|
|||
|
||||
_zimfw_clean_compiled() {
|
||||
# Array with unique dirs. ${ZIM_HOME} or any subdirectory should only occur once.
|
||||
local -Ur zscriptdirs=(${ZIM_HOME} ${${(v)_zdirs##${ZIM_HOME}/*}:A})
|
||||
local -Ur zscriptdirs=(${ZIM_HOME:A} ${${(v)_zdirs##${ZIM_HOME:A}/*}:A})
|
||||
local zopt
|
||||
if (( _zprintlevel > 0 )) zopt=-v
|
||||
command rm -f ${zopt} ${^zscriptdirs}/**/*.zwc(|.old)(N) && \
|
||||
|
@ -433,7 +433,7 @@ _zimfw_compile() {
|
|||
}
|
||||
|
||||
_zimfw_info() {
|
||||
print -R 'zimfw version: '${_zversion}' (built at 2023-03-28 12:56:15 UTC, previous commit is 312b08c)'
|
||||
print -R 'zimfw version: '${_zversion}' (built at 2023-03-30 13:32:54 UTC, previous commit is ee93f79)'
|
||||
local zparam
|
||||
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}
|
||||
|
|
Loading…
Reference in a new issue