From 5b8f8d874e21feb8323e6fc1c919edcafc2a8468 Mon Sep 17 00:00:00 2001 From: Travis Swicegood Date: Wed, 5 Dec 2018 21:53:39 -0600 Subject: [PATCH] Default to loading everything The tests are failing because $1 is being passed through from the initial loading. When this loads in the shell, $1 is empty though so the code works-for-me, but just not the tests. This filters the $1 input to ensure its one of the valid types expected inside the ./enabled directory. --- scripts/reloader.bash | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/reloader.bash b/scripts/reloader.bash index 66236042..e5cf178f 100644 --- a/scripts/reloader.bash +++ b/scripts/reloader.bash @@ -4,7 +4,11 @@ pushd "${BASH_IT}" >/dev/null || exit 1 # TODO: Add debugging output if [ "$1" != "false" ] && [ -d "./enabled" ]; then - for _bash_it_config_file in $(sort <(compgen -G "./enabled/*${1}.bash")); do + _bash_it_config_type="" + if [[ "${1}" =~ ^(alias|completion|plugin)$ ]]; then + _bash_it_config_type=$1 + fi + for _bash_it_config_file in $(sort <(compgen -G "./enabled/*${_bash_it_config_type}.bash")); do if [ -e "${_bash_it_config_file}" ]; then # shellcheck source=/dev/null source $_bash_it_config_file @@ -28,4 +32,5 @@ if [ ! -z "${2}" ] && [ -d "${2}/enabled" ]; then fi unset _bash_it_config_file +unset _bash_it_config_type popd >/dev/null || exit 1