mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
17 lines
312 B
Bash
17 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 "
|
|
}
|