Give credit to zrecompile doc in zshcontrib(1)
and make code closer to the one in the manual pages (unless for our code style). Why reinvent the wheel? This last change makes the arguments to zrecompile shorter (passing relative paths instead of full paths to each function file). The number of arguments can be huge. There are 1143 of them currently for /usr/local/Cellar/zsh/5.7.1/share/zsh/functions!
This commit is contained in:
parent
e2e2cfc22c
commit
eaebf1731c
2 changed files with 7 additions and 5 deletions
|
@ -12,12 +12,13 @@ _zimfw_compile() {
|
||||||
# Compile .zshrc
|
# Compile .zshrc
|
||||||
zrecompile -p ${1} <%= home %>/.zshrc || return 1
|
zrecompile -p ${1} <%= home %>/.zshrc || return 1
|
||||||
|
|
||||||
# Compile autoloaded functions
|
# Compile autoloaded functions, taken from zrecompile doc in zshcontrib(1)
|
||||||
for zdir in ${fpath}; do
|
for zdir in ${fpath}; do
|
||||||
[[ ${zdir} == (.|..) || ${zdir} == (.|..)/* ]] && continue
|
[[ ${zdir} == (.|..) || ${zdir} == (.|..)/* ]] && continue
|
||||||
zfile=(${zdir}/^(*.*)(N-.))
|
zfile=(${zdir}/^(*.*)(N-.))
|
||||||
if [[ -w ${zdir:h} && -n ${zfile} ]]; then
|
if [[ -w ${zdir:h} && -n ${zfile} ]]; then
|
||||||
zrecompile -p ${1} ${zdir}.zwc ${zfile} || return 1
|
zfile=(${${(M)zfile%/*/*}#/})
|
||||||
|
(cd ${zdir:h} && zrecompile -p ${1} ${zdir:t}.zwc ${zfile}) || return 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
@ -46,12 +46,13 @@ _zimfw_compile() {
|
||||||
# Compile .zshrc
|
# Compile .zshrc
|
||||||
zrecompile -p ${1} ${ZDOTDIR:-${HOME}}/.zshrc || return 1
|
zrecompile -p ${1} ${ZDOTDIR:-${HOME}}/.zshrc || return 1
|
||||||
|
|
||||||
# Compile autoloaded functions
|
# Compile autoloaded functions, taken from zrecompile doc in zshcontrib(1)
|
||||||
for zdir in ${fpath}; do
|
for zdir in ${fpath}; do
|
||||||
[[ ${zdir} == (.|..) || ${zdir} == (.|..)/* ]] && continue
|
[[ ${zdir} == (.|..) || ${zdir} == (.|..)/* ]] && continue
|
||||||
zfile=(${zdir}/^(*.*)(N-.))
|
zfile=(${zdir}/^(*.*)(N-.))
|
||||||
if [[ -w ${zdir:h} && -n ${zfile} ]]; then
|
if [[ -w ${zdir:h} && -n ${zfile} ]]; then
|
||||||
zrecompile -p ${1} ${zdir}.zwc ${zfile} || return 1
|
zfile=(${${(M)zfile%/*/*}#/})
|
||||||
|
(cd ${zdir:h} && zrecompile -p ${1} ${zdir:t}.zwc ${zfile}) || return 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -264,7 +265,7 @@ _zimfw_clean_dumpfile() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_zimfw_info() {
|
_zimfw_info() {
|
||||||
print 'Zim version: 1.0.0-SNAPSHOT (previous commit is 69d609d)'
|
print 'Zim version: 1.0.0-SNAPSHOT (previous commit is 660b8cd)'
|
||||||
print -R 'ZIM_HOME: '${ZIM_HOME}
|
print -R 'ZIM_HOME: '${ZIM_HOME}
|
||||||
print -R 'Zsh version: '${ZSH_VERSION}
|
print -R 'Zsh version: '${ZSH_VERSION}
|
||||||
print -R 'System info: '$(command uname -a)
|
print -R 'System info: '$(command uname -a)
|
||||||
|
|
Loading…
Reference in a new issue