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