36 lines
1.0 KiB
Plaintext
36 lines
1.0 KiB
Plaintext
_zimfw_compile() {
|
|
setopt LOCAL_OPTIONS EXTENDED_GLOB
|
|
autoload -U zrecompile
|
|
|
|
local zdir zfile
|
|
local -a zmodules
|
|
zstyle -a ':zim' modules 'zmodules'
|
|
|
|
# Compile the completion cache; significant speedup
|
|
local zdumpfile
|
|
zstyle -s ':zim:completion' dumpfile 'zdumpfile' || zdumpfile="<%= home %>/.zcompdump"
|
|
if [[ -f ${zdumpfile} ]]; then
|
|
zrecompile -p ${1} ${zdumpfile} || return 1
|
|
fi
|
|
|
|
# Compile .zshrc
|
|
zrecompile -p ${1} <%= home %>/.zshrc || return 1
|
|
|
|
# Compile enabled modules' autoloaded functions
|
|
for zdir in ${ZIM_HOME}/modules/${^zmodules}/functions(/FN); do
|
|
zrecompile -p ${1} ${zdir}.zwc ${zdir}/<%= functions_glob %>(-.N) || return 1
|
|
done
|
|
|
|
# Compile enabled modules' scripts
|
|
for zfile in ${ZIM_HOME}/modules/${^zmodules}/(^*test*/)#*.zsh{,-theme}(.NLk+1); do
|
|
zrecompile -p ${1} ${zfile} || return 1
|
|
done
|
|
|
|
# Compile this script
|
|
zrecompile -p ${1} ${ZIM_HOME}/<%= script_filename %> || return 1
|
|
|
|
if [[ ${1} != -q ]]; then
|
|
print -P '%F{green}✓%f Done with compile.'
|
|
fi
|
|
}
|