feat(Config): Implement configuration severity policy and logging mechanism (#23284)

This commit is contained in:
Yehonal
2025-10-25 01:16:09 +02:00
committed by GitHub
parent d58046032b
commit a05cc525f0
23 changed files with 541 additions and 124 deletions

View File

@@ -1,17 +1,19 @@
function registerHooks() { acore_event_registerHooks "$@"; }
function runHooks() { acore_event_runHooks "$@"; }
#shellcheck source=../../conf/dist/config.sh
source "$AC_PATH_CONF/dist/config.sh" # include dist to avoid missing conf variables
function acore_common_loadConfig() {
#shellcheck source=../../conf/dist/config.sh
source "$AC_PATH_CONF/dist/config.sh" # include dist to avoid missing conf variables
# first check if it's defined in env, otherwise use the default
USER_CONF_PATH=${USER_CONF_PATH:-"$AC_PATH_CONF/config.sh"}
# first check if it's defined in env, otherwise use the default
USER_CONF_PATH=${USER_CONF_PATH:-"$AC_PATH_CONF/config.sh"}
if [ -f "$USER_CONF_PATH" ]; then
source "$USER_CONF_PATH" # should overwrite previous
else
echo "NOTICE: file <$USER_CONF_PATH> not found, we use default configuration only."
fi
if [ -f "$USER_CONF_PATH" ]; then
source "$USER_CONF_PATH" # should overwrite previous
else
echo "NOTICE: file <$USER_CONF_PATH> not found, we use default configuration only."
fi
}
#
# Load modules

View File

@@ -25,4 +25,6 @@ export AC_PATH_MODULES="$AC_PATH_ROOT/modules"
export AC_PATH_DEPS="$AC_PATH_ROOT/deps"
export AC_BASH_LIB_PATH="$AC_PATH_DEPS/acore/bash-lib/src"
export AC_PATH_VAR="$AC_PATH_ROOT/var"

View File

@@ -16,6 +16,8 @@ source "$AC_PATH_DEPS/acore/bash-lib/src/event/hooks.sh"
# shellcheck source=./common.sh
source "$AC_PATH_SHARED/common.sh"
acore_common_loadConfig
if [[ "$OSTYPE" = "msys" ]]; then
AC_BINPATH_FULL="$BINPATH"
else