From ac17b713a8b9c160f7877c0878a58c0a0d1159b3 Mon Sep 17 00:00:00 2001 From: John D Pell Date: Sat, 29 Jan 2022 22:24:22 -0800 Subject: [PATCH] lib: delete `appearance.bash` This adds *two* lines to `bash_it.sh`. Just not worth an extra file requiring special handling. --- bash_it.sh | 18 ++++++++++-------- lib/appearance.bash | 18 ------------------ 2 files changed, 10 insertions(+), 26 deletions(-) delete mode 100644 lib/appearance.bash diff --git a/bash_it.sh b/bash_it.sh index f3d9c2e9..ca87332a 100755 --- a/bash_it.sh +++ b/bash_it.sh @@ -22,11 +22,9 @@ _bash_it_library_finalize_hook=() # We need to load logging module early in order to be able to log source "${BASH_IT}/lib/log.bash" -# libraries, but skip appearance (themes) for now -_log_debug "Loading libraries(except appearance)..." -APPEARANCE_LIB="${BASH_IT}/lib/appearance.bash" +# Load libraries +_log_debug "Loading libraries..." for _bash_it_main_file_lib in "${BASH_IT}/lib"/*.bash; do - [[ "$_bash_it_main_file_lib" == "$APPEARANCE_LIB" ]] && continue _bash-it-log-prefix-by-path "${_bash_it_main_file_lib}" _log_debug "Loading library file..." # shellcheck disable=SC1090 @@ -54,10 +52,14 @@ if [[ -n "${BASH_IT_THEME:-}" ]]; then source "${BASH_IT}/themes/base.theme.bash" BASH_IT_LOG_PREFIX="lib: appearance: " - # appearance (themes) now, after all dependencies - # shellcheck source=SCRIPTDIR/lib/appearance.bash - source "$APPEARANCE_LIB" - BASH_IT_LOG_PREFIX="core: main: " + # shellcheck disable=SC1090 + if [[ -f "${BASH_IT_THEME}" ]]; then + source "${BASH_IT_THEME}" + elif [[ -f "$CUSTOM_THEME_DIR/$BASH_IT_THEME/$BASH_IT_THEME.theme.bash" ]]; then + source "$CUSTOM_THEME_DIR/$BASH_IT_THEME/$BASH_IT_THEME.theme.bash" + elif [[ -f "$BASH_IT/themes/$BASH_IT_THEME/$BASH_IT_THEME.theme.bash" ]]; then + source "$BASH_IT/themes/$BASH_IT_THEME/$BASH_IT_THEME.theme.bash" + fi fi _log_debug "Loading custom aliases, completion, plugins..." diff --git a/lib/appearance.bash b/lib/appearance.bash deleted file mode 100644 index e77a1a80..00000000 --- a/lib/appearance.bash +++ /dev/null @@ -1,18 +0,0 @@ -# shellcheck shell=bash - -: "${CLICOLOR:=$(tput colors)}" -export CLICOLOR - -: "${CUSTOM_THEME_DIR:="${BASH_IT_CUSTOM:=${BASH_IT}/custom}/themes"}" - -# Load the theme -# shellcheck disable=SC1090 -if [[ -n "${BASH_IT_THEME:-}" ]]; then - if [[ -f "${BASH_IT_THEME}" ]]; then - source "${BASH_IT_THEME}" - elif [[ -f "$CUSTOM_THEME_DIR/$BASH_IT_THEME/$BASH_IT_THEME.theme.bash" ]]; then - source "$CUSTOM_THEME_DIR/$BASH_IT_THEME/$BASH_IT_THEME.theme.bash" - else - source "$BASH_IT/themes/$BASH_IT_THEME/$BASH_IT_THEME.theme.bash" - fi -fi