From dcb05f00e1ad6083d6a9aa0590440b5b9ef37ec1 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 13 Mar 2022 05:36:53 +0000 Subject: Whitespace and formatting --- bash/bashrc | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'bash/bashrc') diff --git a/bash/bashrc b/bash/bashrc index 854fe7e..e167fee 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -14,28 +14,41 @@ BASH_SOURCE_LAST=( for f in "${BASH_SOURCE_FIRST[@]}"; do file="${XDG_CONFIG_HOME:-$HOME/.config}/bash/$f.bash" - [[ -r "$file" ]] && source "$file" # || echo >&2 "no '$file' found" + if [[ -r "$file" ]]; then + # echo >&2 "Sourcing '$file'" + source "$file" + else + : + # echo >&2 "No '$file' found" + fi done for file in "$XDG_CONFIG_HOME"/bash/*.bash; do file_base="${file##*/}" - memq "${file_base%.bash}" "${BASH_SOURCE_FIRST[@]}" && { + if memq "${file_base%.bash}" "${BASH_SOURCE_FIRST[@]}"; then # echo >&2 "'$file' in BASH_SOURCE_FIRST, skipping" continue - } - memq "${file_base%.bash}" "${BASH_SOURCE_LAST[@]}" && { + elif memq "${file_base%.bash}" "${BASH_SOURCE_LAST[@]}"; then # echo >&2 "'$file' in BASH_SOURCE_LAST, skipping" continue - } - [[ -r "$file" ]] && { + elif [[ -r "$file" ]]; then # echo >&2 "Sourcing '$file'" source "$file" - } + else + : + # echo >&2 "No '$file' found" + fi unset file_base done for f in "${BASH_SOURCE_LAST[@]}"; do file="${XDG_CONFIG_HOME:-$HOME/.config}/bash/$f.bash" - [[ -r "$file" ]] && source "$file" # || echo >&2 "no '$file' found" - true + if [[ -r "$file" ]]; then + source "$file" + else + : + #echo >&2 "No '$file' found" + fi done + +true -- cgit 1.4.1-21-gabe81