about summary refs log tree commit diff stats
path: root/bash
diff options
context:
space:
mode:
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc31
1 files changed, 22 insertions, 9 deletions
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=(
14 14
15for f in "${BASH_SOURCE_FIRST[@]}"; do 15for f in "${BASH_SOURCE_FIRST[@]}"; do
16 file="${XDG_CONFIG_HOME:-$HOME/.config}/bash/$f.bash" 16 file="${XDG_CONFIG_HOME:-$HOME/.config}/bash/$f.bash"
17 [[ -r "$file" ]] && source "$file" # || echo >&2 "no '$file' found" 17 if [[ -r "$file" ]]; then
18 # echo >&2 "Sourcing '$file'"
19 source "$file"
20 else
21 :
22 # echo >&2 "No '$file' found"
23 fi
18done 24done
19 25
20for file in "$XDG_CONFIG_HOME"/bash/*.bash; do 26for file in "$XDG_CONFIG_HOME"/bash/*.bash; do
21 file_base="${file##*/}" 27 file_base="${file##*/}"
22 memq "${file_base%.bash}" "${BASH_SOURCE_FIRST[@]}" && { 28 if memq "${file_base%.bash}" "${BASH_SOURCE_FIRST[@]}"; then
23 # echo >&2 "'$file' in BASH_SOURCE_FIRST, skipping" 29 # echo >&2 "'$file' in BASH_SOURCE_FIRST, skipping"
24 continue 30 continue
25 } 31 elif memq "${file_base%.bash}" "${BASH_SOURCE_LAST[@]}"; then
26 memq "${file_base%.bash}" "${BASH_SOURCE_LAST[@]}" && {
27 # echo >&2 "'$file' in BASH_SOURCE_LAST, skipping" 32 # echo >&2 "'$file' in BASH_SOURCE_LAST, skipping"
28 continue 33 continue
29 } 34 elif [[ -r "$file" ]]; then
30 [[ -r "$file" ]] && {
31 # echo >&2 "Sourcing '$file'" 35 # echo >&2 "Sourcing '$file'"
32 source "$file" 36 source "$file"
33 } 37 else
38 :
39 # echo >&2 "No '$file' found"
40 fi
34 unset file_base 41 unset file_base
35done 42done
36 43
37for f in "${BASH_SOURCE_LAST[@]}"; do 44for f in "${BASH_SOURCE_LAST[@]}"; do
38 file="${XDG_CONFIG_HOME:-$HOME/.config}/bash/$f.bash" 45 file="${XDG_CONFIG_HOME:-$HOME/.config}/bash/$f.bash"
39 [[ -r "$file" ]] && source "$file" # || echo >&2 "no '$file' found" 46 if [[ -r "$file" ]]; then
40 true 47 source "$file"
48 else
49 :
50 #echo >&2 "No '$file' found"
51 fi
41done 52done
53
54true