main: simplify flow of lib loader loop
Eliminate the separate loop for `vendor/init.d` since it's just as easy to glob it in the `lib` loop.pull/1904/head
parent
a71c98e84b
commit
437fd2a928
18
bash_it.sh
18
bash_it.sh
|
|
@ -30,27 +30,15 @@ fi
|
||||||
# libraries, but skip appearance (themes) for now
|
# libraries, but skip appearance (themes) for now
|
||||||
_log_debug "Loading libraries(except appearance)..."
|
_log_debug "Loading libraries(except appearance)..."
|
||||||
APPEARANCE_LIB="${BASH_IT}/lib/appearance.bash"
|
APPEARANCE_LIB="${BASH_IT}/lib/appearance.bash"
|
||||||
for _bash_it_lib_file in "${BASH_IT}"/lib/*.bash; do
|
for _bash_it_lib_file in "${BASH_IT}"/lib/*.bash "${BASH_IT}/vendor/init.d"/*.bash; do
|
||||||
if [[ "$_bash_it_lib_file" != "$APPEARANCE_LIB" ]]; then
|
[[ "$_bash_it_lib_file" == "$APPEARANCE_LIB" ]] && continue
|
||||||
_bash-it-log-prefix-by-path "${_bash_it_lib_file}"
|
_bash-it-log-prefix-by-path "${_bash_it_lib_file}"
|
||||||
_log_debug "Loading library file..."
|
_log_debug "Loading library file..."
|
||||||
# shellcheck source-path=SCRIPTDIR/lib disable=SC1090
|
# shellcheck source-path=SCRIPTDIR/lib;SCRIPTDIR/vendor/init.d disable=SC1090
|
||||||
source "$_bash_it_lib_file"
|
source "$_bash_it_lib_file"
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
unset _bash_it_lib_file
|
unset _bash_it_lib_file
|
||||||
|
|
||||||
# Load vendors
|
|
||||||
BASH_IT_LOG_PREFIX="vendor: "
|
|
||||||
for _bash_it_vendor_init in "${BASH_IT}/vendor/init.d"/*.bash; do
|
|
||||||
filename="${_bash_it_vendor_init##*/}"
|
|
||||||
filename="${filename%.bash}"
|
|
||||||
_log_debug "Loading '${filename}'..."
|
|
||||||
# shellcheck disable=SC1090
|
|
||||||
source "${_bash_it_vendor_init}"
|
|
||||||
done
|
|
||||||
unset _bash_it_vendor_init filename
|
|
||||||
|
|
||||||
BASH_IT_LOG_PREFIX="core: main: "
|
BASH_IT_LOG_PREFIX="core: main: "
|
||||||
# Load the global "enabled" directory
|
# Load the global "enabled" directory
|
||||||
# "family" param is empty so that files get sources in glob order
|
# "family" param is empty so that files get sources in glob order
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue