added ability to dynamically source files from file in home directory

added explanation and example in README.md
This commit is contained in:
2024-03-24 09:50:29 +01:00
parent 3c9736d165
commit 0eb28cf6cc
2 changed files with 27 additions and 0 deletions

View File

@@ -1,4 +1,15 @@
# Source all the overrides in this folder
for source in $(find "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" -type f | grep -Ev "_all|terminal_fancyfying"); do
. "${source}"
done
. "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)/terminal_fancyfying_${TERMINAL_FANCYFY}"
# If the file ~/.bash_sources exist, source every line it contains
if [ -f ~/.bash_sources ]; then
while IFS= read -r line; do
# Skip empty lines and comments (#)
if [ -n "$line" ] && ! [[ "$line" == \#* ]]; then
. "$line"
fi
done < ~/.bash_sources
fi