Skip to content

Commit

Permalink
Glob for *.bash properly when path contains spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
gaelicWizard committed Aug 26, 2021
1 parent 5e780d4 commit 7a24219
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions bash_it.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ cite about-alias about-plugin about-completion

# libraries, but skip appearance (themes) for now
_log_debug "Loading libraries(except appearance)..."
LIB="${BASH_IT}/lib/*.bash"
APPEARANCE_LIB="${BASH_IT}/lib/appearance.bash"
for _bash_it_config_file in $LIB; do
for _bash_it_config_file in "${BASH_IT}"/lib/*.bash; do
if [ "$_bash_it_config_file" != "$APPEARANCE_LIB" ]; then
filename=${_bash_it_config_file##*/}
filename=${filename%.bash}
Expand Down Expand Up @@ -109,19 +108,20 @@ done
# Custom
BASH_IT_LOG_PREFIX="core: main: "
_log_debug "Loading general custom files..."
CUSTOM="${BASH_IT_CUSTOM:=${BASH_IT}/custom}/*.bash ${BASH_IT_CUSTOM:=${BASH_IT}/custom}/**/*.bash"
for _bash_it_config_file in $CUSTOM; do
: "${BASH_IT_CUSTOM:=${BASH_IT}/custom}"
for _bash_it_config_file in "$BASH_IT_CUSTOM"/*.bash "$BASH_IT_CUSTOM"/**/*.bash
do
if [ -e "${_bash_it_config_file}" ]; then
filename=$(basename "${_bash_it_config_file}")
filename=${filename%*.bash}
filename="$(basename "${_bash_it_config_file}")"
filename="${filename%*.bash}"
BASH_IT_LOG_PREFIX="custom: $filename: "
_log_debug "Loading custom file..."
# shellcheck disable=SC1090
source "$_bash_it_config_file"
fi
done

unset _bash_it_config_file

if [[ $PROMPT ]]; then
export PS1="\[""$PROMPT""\]"
fi
Expand Down

0 comments on commit 7a24219

Please sign in to comment.