From bd52e1689573bfc296caf6fb19827e84cc45aa09 Mon Sep 17 00:00:00 2001 From: Kevin Glowacz Date: Thu, 22 Sep 2016 10:55:22 -0500 Subject: [PATCH] Remove `continue` from conditional This is an artifact left over from when this function was extracted from inside a loop https://github.com/Bash-it/bash-it/commit/b524bb604756d33ec330abe5300a7a1a6d3a833b However, `continue` isn't doing anything when not inside a loop and this now raises a warning in bash 4.4: "continue: only meaningful in a `for', `while', or `until' loop" --- lib/helpers.bash | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/helpers.bash b/lib/helpers.bash index 3c1c1f03..607e0047 100644 --- a/lib/helpers.bash +++ b/lib/helpers.bash @@ -1,17 +1,16 @@ # Helper function loading various enable-able files function _load_bash_it_files() { subdirectory="$1" - if [ ! -d "${BASH_IT}/${subdirectory}/enabled" ] + if [ -d "${BASH_IT}/${subdirectory}/enabled" ] then - continue + FILES="${BASH_IT}/${subdirectory}/enabled/*.bash" + for config_file in $FILES + do + if [ -e "${config_file}" ]; then + source $config_file + fi + done fi - FILES="${BASH_IT}/${subdirectory}/enabled/*.bash" - for config_file in $FILES - do - if [ -e "${config_file}" ]; then - source $config_file - fi - done } # Function for reloading aliases