[zsh] Move func/ directory to zsh/functions

This commit is contained in:
Eryn Wells 2026-01-18 08:43:02 -07:00
parent 91da2fc583
commit 7c08c5131f
53 changed files with 1 additions and 1 deletions

View file

@ -1,39 +0,0 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
function load_module
{
local mod=$1
if [[ -z "$mod" ]]; then
print "Missing argument: path to module to load." >&2
return -1
fi
# Make sure $mod isn't already in $fpath
local modpath
for p in $fpath; do
modpath=$p/$mod
[[ -d $modpath ]] && break
modpath=''
done
if [[ -z "$modpath" ]]; then
return 1
fi
fpath+=($modpath)
for file in $modpath/*; do
if [[ -f "$file" ]]; then
autoload $func
fi
if [[ -d "$file" ]]; then
load_module "$file"
fi
done
return 0
}
load_module "$@"