mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-12-01 21:13:04 +08:00
restructured repository based on following standards:
https://github.com/HW-Core/directory-structure
This commit is contained in:
16
bin/bash_shared/functions.sh
Normal file
16
bin/bash_shared/functions.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
# 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 "
|
||||
}
|
||||
Reference in New Issue
Block a user