This commit is contained in:
Marc Beninca 2024-11-13 14:38:35 +01:00
parent 6603c88198
commit 216fe057c9
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -19,21 +19,21 @@ main_import_modules() {
local ifs module modules path root
path="$(realpath --canonicalize-existing "${file}")"
root="$(dirname "${path}")"
echo
echo "${root}"
modules="$(find "${root}" -type "f" -name "*.sh" -printf "%P
" | sort)"
ifs="${IFS}"
IFS="
"
for module in ${modules}; do
echo "${module%.sh}"
module="${root}/${module}"
if [ "${module}" != "${path}" ]; then
. "${module}"
fi
done
IFS="${ifs}"
log_info
log_info "${root}"
log_info "${modules}"
return 0
else
log_fatal "No file: ${file}"