From 68c2515b5a805c1f3cf796b4a15ba575d67ca1ba Mon Sep 17 00:00:00 2001 From: femsci Date: Sat, 5 Nov 2022 01:06:12 +0100 Subject: [PATCH] Update _init. Add configuration option. --- config.d/CONFIGURATION | 9 +++++++++ hooks/_init.sh | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 config.d/CONFIGURATION diff --git a/config.d/CONFIGURATION b/config.d/CONFIGURATION new file mode 100644 index 0000000..b848487 --- /dev/null +++ b/config.d/CONFIGURATION @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# +# You can set various options as environment variables here. +# For instance: +# PINCH_CFG='test' +# will create a variable PINCH_CFG with test as the content. +# + diff --git a/hooks/_init.sh b/hooks/_init.sh index 1d8ac44..f6074d3 100755 --- a/hooks/_init.sh +++ b/hooks/_init.sh @@ -38,6 +38,15 @@ export -f err_trap trap err_trap ERR +pdebug "Retrieving configuration..." +set -a +for cff in $(ls $HOOK_PATH/../config.d/) +do + pdebug "Sourcing $cff" + source $HOOK_PATH/../config.d/$cff +done +set +a + exec_custom() { local hooks_path=$HOOK_PATH/../custom.d/$1