mirror of
https://github.com/azerothcore/azerothcore-wotlk.git
synced 2025-12-06 02:30:26 -08:00
16 lines
312 B
Bash
16 lines
312 B
Bash
# 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 "
|
|
}
|