Remove zshlib as submodule

This commit is contained in:
T. R. Bernstein
2024-07-01 19:44:12 +02:00
committed by T. R. Bernstein
parent cf459b84bd
commit 4fa98ea9a5
5 changed files with 67 additions and 40 deletions

View File

@@ -2,14 +2,13 @@
# vi: set ft=zsh tw=80 ts=2
function autoloadZShLib() {
test -d "${ASTZWEIG_ZSHLIB}" || { echo "This module needs astzweig/zshlib to work." >&2; return 99 }
FPATH="${ASTZWEIG_ZSHLIB}:${FPATH}"
[[ -d ${ASTZWEIG_ZSHLIB} || -f ${ASTZWEIG_ZSHLIB} ]] || { echo "This module needs astzweig/zshlib to work." >&2; return 99 }
fpath+=(${ASTZWEIG_ZSHLIB})
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}
autoload -Uzw ${ASTZWEIG_ZSHLIB:t}
fi
}