diff options
author | Case Duckworth | 2021-09-05 12:06:19 -0500 |
---|---|---|
committer | Case Duckworth | 2021-09-05 12:07:10 -0500 |
commit | 01067990cce27b7af94506f583de025d28e31c1b (patch) | |
tree | 326acef39b1956003a2555ff405fe082098901a0 /bash/bashrc | |
parent | Search multiple files for __git_ps1 function (diff) | |
download | etc-01067990cce27b7af94506f583de025d28e31c1b.tar.gz etc-01067990cce27b7af94506f583de025d28e31c1b.zip |
Change bootstrapping method
Now uses a script, ./bootstrap.sh, and a file, ./bootstrap.manifest.
Diffstat (limited to 'bash/bashrc')
-rw-r--r-- | bash/bashrc | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/bash/bashrc b/bash/bashrc new file mode 100644 index 0000000..4966e75 --- /dev/null +++ b/bash/bashrc | |||
@@ -0,0 +1,41 @@ | |||
1 | # bashrc | ||
2 | |||
3 | # If not running interactively, don't do anything | ||
4 | [[ $- != *i* ]] && return | ||
5 | |||
6 | BASH_SOURCE_FIRST=( | ||
7 | aliases | ||
8 | functions | ||
9 | ) | ||
10 | |||
11 | BASH_SOURCE_LAST=( | ||
12 | blesh | ||
13 | ) | ||
14 | |||
15 | for f in "${BASH_SOURCE_FIRST[@]}"; do | ||
16 | file="${XDG_CONFIG_HOME:-$HOME/.config}/bash/$f.bash" | ||
17 | [[ -r "$file" ]] && source "$file" # || echo >&2 "no '$file' found" | ||
18 | done | ||
19 | |||
20 | for file in "$XDG_CONFIG_HOME"/bash/*.bash; do | ||
21 | file_base="${file##*/}" | ||
22 | memq "${file_base%.bash}" "${BASH_SOURCE_FIRST[@]}" && { | ||
23 | # echo >&2 "'$file' in BASH_SOURCE_FIRST, skipping" | ||
24 | continue | ||
25 | } | ||
26 | memq "${file_base%.bash}" "${BASH_SOURCE_LAST[@]}" && { | ||
27 | # echo >&2 "'$file' in BASH_SOURCE_LAST, skipping" | ||
28 | continue | ||
29 | } | ||
30 | [[ -r "$file" ]] && { | ||
31 | # echo >&2 "Sourcing '$file'" | ||
32 | source "$file" | ||
33 | } | ||
34 | unset file_base | ||
35 | done | ||
36 | |||
37 | for f in "${BASH_SOURCE_LAST[@]}"; do | ||
38 | file="${XDG_CONFIG_HOME:-$HOME/.config}/bash/$f.bash" | ||
39 | [[ -r "$file" ]] && source "$file" # || echo >&2 "no '$file' found" | ||
40 | true | ||
41 | done | ||