From 9315b2bddad53cbceac524d40282d4b35e0b112e Mon Sep 17 00:00:00 2001 From: Martin Blazik Date: Thu, 21 Apr 2022 07:34:10 +0200 Subject: [PATCH] Load locals bashrc files --- rc/01-functions.sh | 8 ++++++++ rc/99-local.sh | 3 +++ 2 files changed, 11 insertions(+) create mode 100644 rc/99-local.sh diff --git a/rc/01-functions.sh b/rc/01-functions.sh index db5f961..fb94707 100644 --- a/rc/01-functions.sh +++ b/rc/01-functions.sh @@ -48,3 +48,11 @@ function can_run() { command -v "$application" > /dev/null } +function source_directory() { + local mask="$1" + for file in $mask; do + if [[ -f "$file" ]]; then + echo "$file" + fi + done +} diff --git a/rc/99-local.sh b/rc/99-local.sh new file mode 100644 index 0000000..9f5bbaa --- /dev/null +++ b/rc/99-local.sh @@ -0,0 +1,3 @@ +# Load user locals bashrc + +source_directory "$HOME/.bashrc.d/*.sh"