2019-01-22 19:40:43 -05:00
|
|
|
_zimfw_compile() {
|
2019-12-12 09:00:19 -05:00
|
|
|
setopt LOCAL_OPTIONS CASE_GLOB EXTENDED_GLOB
|
2019-01-22 19:40:43 -05:00
|
|
|
autoload -U zrecompile
|
2019-12-01 16:00:47 -05:00
|
|
|
local zdumpfile zdir zfile
|
2019-01-22 19:40:43 -05:00
|
|
|
|
|
|
|
# Compile the completion cache; significant speedup
|
|
|
|
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
|
|
|
|
|
2019-12-10 19:28:00 -05:00
|
|
|
# Compile autoloaded functions, taken from zrecompile doc in zshcontrib(1)
|
2019-12-01 16:00:47 -05:00
|
|
|
for zdir in ${fpath}; do
|
|
|
|
[[ ${zdir} == (.|..) || ${zdir} == (.|..)/* ]] && continue
|
2019-12-09 21:34:12 -05:00
|
|
|
zfile=(${zdir}/^(*.*)(N-.))
|
|
|
|
if [[ -w ${zdir:h} && -n ${zfile} ]]; then
|
2019-12-10 19:28:00 -05:00
|
|
|
zfile=(${${(M)zfile%/*/*}#/})
|
2019-12-12 08:46:27 -05:00
|
|
|
(builtin cd -q ${zdir:h} && zrecompile -p ${1} ${zdir:t}.zwc ${zfile}) || return 1
|
2019-12-01 16:00:47 -05:00
|
|
|
fi
|
2019-01-22 19:40:43 -05:00
|
|
|
done
|
|
|
|
|
2019-12-01 16:00:47 -05:00
|
|
|
# Compile scripts
|
|
|
|
for zfile in ${ZIM_HOME}/(^*test*/)#*.zsh{,-theme}(N-.); do
|
2019-01-22 19:40:43 -05:00
|
|
|
zrecompile -p ${1} ${zfile} || return 1
|
|
|
|
done
|
|
|
|
|
|
|
|
if [[ ${1} != -q ]]; then
|
2019-12-13 07:14:10 -05:00
|
|
|
print -P '<%= done %>Done with compile.'
|
2019-01-22 19:40:43 -05:00
|
|
|
fi
|
|
|
|
}
|