From 5433ef186ae6c6559c44000364279af845f288b1 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 14 May 2023 14:46:23 +0200 Subject: [PATCH] modules --- bash/main.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bash/main.sh b/bash/main.sh index c8d6e1e..d858f6d 100644 --- a/bash/main.sh +++ b/bash/main.sh @@ -8,13 +8,19 @@ function link_bashrc { ln --symbolic "${MAIN_FILE}" "${file}" } +# import modules function main_import_modules { -local module - for module in "${MAIN_ROOT}"/*.sh ; do + local IFS=$'\n' + local modules=($(find "${MAIN_ROOT}" -type 'f' -name '*.sh')) + local module + for module in "${modules[@]}" ; do if [ "${module}" != "${MAIN_FILE}" ] ; then + echo + echo "${module}" source "${module}" fi done } +# import modules main_import_modules