1
0
Fork 0
mirror of synced 2024-11-22 23:35:35 -05:00

Don't fail zimfw compile on empty fpath dir

otherwise it would fail with, for example

    zrecompile:zcompile:133: can't open file /usr/local/share/zsh/site-functions
This commit is contained in:
Eric Nielsen 2019-12-09 21:34:12 -05:00
parent 3ec1772ef2
commit 196a0585f7
No known key found for this signature in database
GPG key ID: 47D1DBFA0765A1FB
2 changed files with 7 additions and 5 deletions

View file

@ -15,8 +15,9 @@ _zimfw_compile() {
# Compile autoloaded functions # Compile autoloaded functions
for zdir in ${fpath}; do for zdir in ${fpath}; do
[[ ${zdir} == (.|..) || ${zdir} == (.|..)/* ]] && continue [[ ${zdir} == (.|..) || ${zdir} == (.|..)/* ]] && continue
if [[ -w ${zdir:h} ]]; then zfile=(${zdir}/^(*.*)(N-.))
zrecompile -p ${1} ${zdir}.zwc ${zdir}/^(*.*)(N-.) || return 1 if [[ -w ${zdir:h} && -n ${zfile} ]]; then
zrecompile -p ${1} ${zdir}.zwc ${zfile} || return 1
fi fi
done done

View file

@ -49,8 +49,9 @@ _zimfw_compile() {
# Compile autoloaded functions # Compile autoloaded functions
for zdir in ${fpath}; do for zdir in ${fpath}; do
[[ ${zdir} == (.|..) || ${zdir} == (.|..)/* ]] && continue [[ ${zdir} == (.|..) || ${zdir} == (.|..)/* ]] && continue
if [[ -w ${zdir:h} ]]; then zfile=(${zdir}/^(*.*)(N-.))
zrecompile -p ${1} ${zdir}.zwc ${zdir}/^(*.*)(N-.) || return 1 if [[ -w ${zdir:h} && -n ${zfile} ]]; then
zrecompile -p ${1} ${zdir}.zwc ${zfile} || return 1
fi fi
done done
@ -278,7 +279,7 @@ _zimfw_clean_dumpfile() {
} }
_zimfw_info() { _zimfw_info() {
print 'Zim version: 1.0.0-SNAPSHOT (previous commit is 106335e)' print 'Zim version: 1.0.0-SNAPSHOT (previous commit is 74404e6)'
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)