From 196a0585f757ed9f36e1250372ca7e5470e0e63c Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Mon, 9 Dec 2019 21:34:12 -0500 Subject: [PATCH] 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 --- src/stage1/50_zimfw_compile.zsh.erb | 5 +++-- zimfw.zsh | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/stage1/50_zimfw_compile.zsh.erb b/src/stage1/50_zimfw_compile.zsh.erb index 523d4e4..5da66fa 100644 --- a/src/stage1/50_zimfw_compile.zsh.erb +++ b/src/stage1/50_zimfw_compile.zsh.erb @@ -15,8 +15,9 @@ _zimfw_compile() { # Compile autoloaded functions for zdir in ${fpath}; do [[ ${zdir} == (.|..) || ${zdir} == (.|..)/* ]] && continue - if [[ -w ${zdir:h} ]]; then - zrecompile -p ${1} ${zdir}.zwc ${zdir}/^(*.*)(N-.) || return 1 + zfile=(${zdir}/^(*.*)(N-.)) + if [[ -w ${zdir:h} && -n ${zfile} ]]; then + zrecompile -p ${1} ${zdir}.zwc ${zfile} || return 1 fi done diff --git a/zimfw.zsh b/zimfw.zsh index cdbf283..4795413 100644 --- a/zimfw.zsh +++ b/zimfw.zsh @@ -49,8 +49,9 @@ _zimfw_compile() { # Compile autoloaded functions for zdir in ${fpath}; do [[ ${zdir} == (.|..) || ${zdir} == (.|..)/* ]] && continue - if [[ -w ${zdir:h} ]]; then - zrecompile -p ${1} ${zdir}.zwc ${zdir}/^(*.*)(N-.) || return 1 + zfile=(${zdir}/^(*.*)(N-.)) + if [[ -w ${zdir:h} && -n ${zfile} ]]; then + zrecompile -p ${1} ${zdir}.zwc ${zfile} || return 1 fi done @@ -278,7 +279,7 @@ _zimfw_clean_dumpfile() { } _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 'Zsh version: '${ZSH_VERSION} print -R 'System info: '$(command uname -a)