From 98056f2fb62aa0504b540348214ee81220feb15d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 9 May 2023 22:15:40 +0200 Subject: [PATCH] source directly --- bash.d/main.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bash.d/main.sh b/bash.d/main.sh index 8fa3fe2..732bad3 100644 --- a/bash.d/main.sh +++ b/bash.d/main.sh @@ -2,8 +2,13 @@ PATH="$(realpath "${BASH_SOURCE[0]}")" ROOT="$(dirname "${PATH}")" -DIRECTORY="${ROOT}/bash.d" +function main { +local module + for module in "${ROOT}"/*.sh ; do + if [ "${module}" != "${PATH}" ] ; then + source "${module}" + fi + done +} -for file in "${DIRECTORY}"/*.sh ; do - source "${file}" -done +main