mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
created hw-core bash libraries
will be traited as a git subtree
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
# par 1: hook_name
|
||||
function runHooks() {
|
||||
hook_name="HOOKS_MAP_$1"
|
||||
read -r -a SRCS <<< ${!hook_name}
|
||||
echo "Running hooks: $hook_name"
|
||||
for i in "${SRCS[@]}"
|
||||
do
|
||||
$i # run registered hook
|
||||
done
|
||||
}
|
||||
|
||||
function registerHooks() {
|
||||
hook_name="HOOKS_MAP_$1"
|
||||
hooks=${@:2}
|
||||
declare -g "$hook_name+=$hooks "
|
||||
}
|
||||
@@ -4,7 +4,10 @@ AC_PATH_SHARED="$AC_PATH_BIN/bash_shared"
|
||||
|
||||
source "$AC_PATH_SHARED/defines.sh"
|
||||
|
||||
source "$AC_PATH_SHARED/functions.sh"
|
||||
source "$AC_PATH_MODULES/hw-core/bash-lib-event/src/hooks.sh"
|
||||
|
||||
alias registerHooks="hwc_event_register_hooks"
|
||||
alias runHooks="hwc_event_run_hooks"
|
||||
|
||||
source "$AC_PATH_CONF/config.sh.dist" # "hack" to avoid missing conf variables
|
||||
|
||||
|
||||
Reference in New Issue
Block a user