From 01067990cce27b7af94506f583de025d28e31c1b Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 5 Sep 2021 12:06:19 -0500 Subject: Change bootstrapping method Now uses a script, ./bootstrap.sh, and a file, ./bootstrap.manifest. --- bash/bash_logout | 6 ++++++ bash/bash_profile | 4 ++++ bash/bashrc | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 bash/bash_logout create mode 100644 bash/bash_profile create mode 100644 bash/bashrc (limited to 'bash') diff --git a/bash/bash_logout b/bash/bash_logout new file mode 100644 index 0000000..d6c9b7a --- /dev/null +++ b/bash/bash_logout @@ -0,0 +1,6 @@ +# bash_logout +# vim:ft=sh + +if [[ -r "$XDG_CONFIG_HOME"/bash/logout ]]; then + source "$XDG_CONFIG_HOME"/bash/logout +fi diff --git a/bash/bash_profile b/bash/bash_profile new file mode 100644 index 0000000..4439ca7 --- /dev/null +++ b/bash/bash_profile @@ -0,0 +1,4 @@ +# bash_profile + +[[ -f ~/.profile ]] && source ~/.profile +[[ -f ~/.bashrc ]] && source ~/.bashrc diff --git a/bash/bashrc b/bash/bashrc new file mode 100644 index 0000000..4966e75 --- /dev/null +++ b/bash/bashrc @@ -0,0 +1,41 @@ +# bashrc + +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +BASH_SOURCE_FIRST=( + aliases + functions +) + +BASH_SOURCE_LAST=( + blesh +) + +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" +done + +for file in "$XDG_CONFIG_HOME"/bash/*.bash; do + file_base="${file##*/}" + memq "${file_base%.bash}" "${BASH_SOURCE_FIRST[@]}" && { + # echo >&2 "'$file' in BASH_SOURCE_FIRST, skipping" + continue + } + memq "${file_base%.bash}" "${BASH_SOURCE_LAST[@]}" && { + # echo >&2 "'$file' in BASH_SOURCE_LAST, skipping" + continue + } + [[ -r "$file" ]] && { + # echo >&2 "Sourcing '$file'" + source "$file" + } + 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 +done -- cgit 1.4.1-21-gabe81