First working copy of autoload

This commit is contained in:
Paul 2022-06-12 13:26:38 -05:00
parent f8ff3fe5b9
commit 67e3a383d7
6 changed files with 47 additions and 0 deletions

23
test.bash Executable file
View file

@ -0,0 +1,23 @@
#!/bin/bash
set -Eeuo pipefail
# 2>/dev/null
# Test file
function autoload {
#echo "Called by $(caller): Couldn't find ${BASH_COMMAND}"
if [[ -f modules/${BASH_COMMAND}.bash ]]
then
source modules/${BASH_COMMAND}.bash
${BASH_COMMAND}
else
echo "I can't find ${BASH_COMMAND}"
fi
}
trap autoload ERR
moo