Handle zwc autoloading case too

This commit is contained in:
Rezart Qelibari
2022-04-20 00:39:03 +02:00
parent 0edd5f546a
commit 65ad175cf4

View File

@@ -3,8 +3,13 @@
function autoloadZShLib() { function autoloadZShLib() {
test -d "${ASTZWEIG_ZSHLIB}" || { echo "This module needs astzweig/zshlib to work." >&2; return 99 } test -d "${ASTZWEIG_ZSHLIB}" || { echo "This module needs astzweig/zshlib to work." >&2; return 99 }
FPATH="${ASTZWEIG_ZSHLIB}:${FPATH}" FPATH="${ASTZWEIG_ZSHLIB}:${FPATH}"
local funcNames=(${(f)"$(find "${ASTZWEIG_ZSHLIB}" -type f -perm +u=x -maxdepth 1 | awk -F/ '{ print $NF }')"}) fpath+=(${ASTZWEIG_ZSHLIB})
autoload -Uz "${funcNames[@]}" if [[ -d ${ASTZWEIG_ZSHLIB} ]]; then
local funcNames=($(find "${ASTZWEIG_ZSHLIB}" -type f -perm +u=x -maxdepth 1 | awk -F/ '{ print $NF }'))
autoload -Uz ${funcNames}
elif [[ -f ${ASTZWEIG_ZSHLIB} ]]; then
autoload -Uzw ${ASTZWEIG_ZSHLIB}
fi
} }
function isDebug() { function isDebug() {