bash-it: Reorder main bash-it.sh so logs can happen

pull/1628/head
Noah Gorny 2020-06-27 14:02:20 +03:00 committed by Noah Gorny
parent 8a3cf76307
commit 811c9ecd71
1 changed files with 11 additions and 6 deletions

View File

@ -6,12 +6,22 @@ BASH_IT_LOG_PREFIX="core: main: "
if [ -z "$BASH_IT" ]; if [ -z "$BASH_IT" ];
then then
# Setting $BASH to maintain backwards compatibility # 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 export BASH_IT=$BASH
BASH="$(bash -c 'echo $BASH')" BASH="$(bash -c 'echo $BASH')"
export BASH export BASH
BASH_IT_OLD_BASH_SETUP=true
fi 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 # For backwards compatibility, look in old BASH_THEME location
if [ -z "$BASH_IT_THEME" ]; if [ -z "$BASH_IT_THEME" ];
then then
@ -20,11 +30,6 @@ then
unset BASH_THEME; unset BASH_THEME;
fi 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 # support 'plumbing' metadata
cite _about _param _example _group _author _version cite _about _param _example _group _author _version