Attempt to simplify by not using aliases

This commit is contained in:
Travis Swicegood
2018-12-04 22:02:10 -06:00
parent 13b6f3d870
commit e5b68695c0
3 changed files with 33 additions and 38 deletions

30
scripts/reloader.bash Normal file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
pushd "${BASH_IT}" >/dev/null
# TODO: Add debugging output
if [ "$1" != "false" ] && [ -d "./enabled" ]; then
for _bash_it_config_file in $(ls ./enabled/*${1}.bash 2>/dev/null); do
if [ -e "${_bash_it_config_file}" ]; then
source $_bash_it_config_file
else
echo "Unable to read ${_bash_it_config_file}" > /dev/stderr
fi
done
fi
if [ ! -z "${2}" ] && [ -d "${2}/enabled" ]; then
# TODO: We should warn users they're using legacy enabling
for _bash_it_config_file in $(ls ./${2}/enabled/*.bash 2>/dev/null); do
if [ -e "$_bash_it_config_file" ]; then
source "$_bash_it_config_file"
else
# TODO Display an error?
echo "Unable to locate ${_bash_it_config_file}" > /dev/null
fi
done
fi
unset _bash_it_config_file
popd >/dev/null