ported double tracking from TC
This commit is contained in:
16
deps/hw-core/bash-lib-event/src/hooks.sh
vendored
Normal file
16
deps/hw-core/bash-lib-event/src/hooks.sh
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
# par 1: hook_name
|
||||
function hwc_event_run_hooks() {
|
||||
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 hwc_event_register_hooks() {
|
||||
hook_name="HOOKS_MAP_$1"
|
||||
hooks=${@:2}
|
||||
declare -g "$hook_name+=$hooks "
|
||||
}
|
||||
7
deps/hw-core/bash-lib-git/bin/git-subtree-list
vendored
Normal file
7
deps/hw-core/bash-lib-git/bin/git-subtree-list
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
CUR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
source $CUR_DIR"/../src/subtree.sh"
|
||||
|
||||
hwc_git_subtree_list
|
||||
3
deps/hw-core/bash-lib-git/src/subtree.sh
vendored
Normal file
3
deps/hw-core/bash-lib-git/src/subtree.sh
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
function hwc_git_subtree_list() {
|
||||
git log | grep git-subtree-dir | tr -d ' ' | cut -d ":" -f2 | sort | uniq
|
||||
}
|
||||
Reference in New Issue
Block a user