This commit is contained in:
Marc Beninca 2024-11-13 09:43:27 +01:00
parent e8c65c9821
commit 0cc06b6de0
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -13,14 +13,14 @@ main_link_bashrc() {
# import modules # import modules
main_import_modules() { main_import_modules() {
local file="${1}" local file="${1}"
if [ -f "${file}" ] ; then if [ -f "${file}" ]; then
local path="$(realpath "${file}")" local path="$(realpath "${file}")"
local root="$(dirname "${path}")" local root="$(dirname "${path}")"
local IFS=$'\n' local IFS=$'\n'
local modules=($(find "${root}" -type "f" -name "*.sh" | sort)) local modules=($(find "${root}" -type "f" -name "*.sh" | sort))
local module local module
for module in "${modules[@]}" ; do for module in "${modules[@]}"; do
if [ "${module}" != "${path}" ] ; then if [ "${module}" != "${path}" ]; then
. "${module}" . "${module}"
fi fi
done done