From 05294374f098196c35fe96dc10fb9cbb3e86db4a Mon Sep 17 00:00:00 2001 From: m8in Date: Thu, 11 Jun 2026 23:21:49 +0200 Subject: [PATCH] The module can be loaded just once now. --- core/base.module.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/base.module.sh b/core/base.module.sh index 260cf4d..10fde3e 100755 --- a/core/base.module.sh +++ b/core/base.module.sh @@ -9,6 +9,9 @@ && echo "Version 4 or newer is required, bash has version : '${BASH_VERSION}'." >&2 \ && exit 1 +# Prevents loading this module twice +[ "${CIS[SET]}" == "ready" ] && return 0 + function base.checkAllInputParameters() { @@ -412,7 +415,7 @@ if [ "${BASH_SOURCE[0]}" == "${0}" ]; then declare -F | grep "base." | cut -d" " -f3 | xargs -n1 printf -- " %s\n" exit 1 elif [ "${CIS[SET]}" == "ready" ]; then - base.log debug "Module '${BASH_SOURCE[0]}' already loaded" + base.abort "Module '${BASH_SOURCE[0]}' already loaded." else # If not exists, define a global array 'COLOR' trap "base.abort ' User-initiated termination.'" INT \