From 811c9ecd716382df14f1a6e03ddf3eee1b5d6693 Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Sat, 27 Jun 2020 14:02:20 +0300 Subject: [PATCH] bash-it: Reorder main bash-it.sh so logs can happen --- bash_it.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/bash_it.sh b/bash_it.sh index fec92c8d..8a277bed 100755 --- a/bash_it.sh +++ b/bash_it.sh @@ -6,12 +6,22 @@ BASH_IT_LOG_PREFIX="core: main: " if [ -z "$BASH_IT" ]; then # Setting $BASH to maintain backwards compatibility - _log_warning "BASH_IT variable not initialized, please upgrade your bash-it version and reinstall it!" export BASH_IT=$BASH BASH="$(bash -c 'echo $BASH')" export BASH + BASH_IT_OLD_BASH_SETUP=true fi +# Load composure first, so we support function metadata +# shellcheck source=./lib/composure.bash +source "${BASH_IT}/lib/composure.bash" +# We need to load logging module first as well in order to be able to log +# shellcheck source=./lib/log.bash +source "${BASH_IT}/lib/log.bash" + +# We can only log it now +[ -z "$BASH_IT_OLD_BASH_SETUP" ] || _log_warning "BASH_IT variable not initialized, please upgrade your bash-it version and reinstall it!" + # For backwards compatibility, look in old BASH_THEME location if [ -z "$BASH_IT_THEME" ]; then @@ -20,11 +30,6 @@ then unset BASH_THEME; fi -_log_debug "Loading composure..." -# Load composure first, so we support function metadata -# shellcheck source=./lib/composure.bash -source "${BASH_IT}/lib/composure.bash" - # support 'plumbing' metadata cite _about _param _example _group _author _version