summaryrefslogtreecommitdiff
path: root/apps/bash_shared/common.sh
blob: acd23eacdf98d520f914e750e31a39060fb16ecf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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

# 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

#
# Load modules
#

for entry in "$AC_PATH_MODULES/"*/include.sh
do
    if [ -e "$entry" ]; then
        source "$entry"
    fi
done

ACORE_VERSION=$("$AC_PATH_DEPS/jsonpath/JSONPath.sh" -f "$AC_PATH_ROOT/acore.json" -b '$.version')