diff --git a/.gitignore b/.gitignore index 3521a66dc..f0bb2e3a7 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ modules/*/* !modules/uwd/* !modules/uwd/cmake-utils/* modules/uwd/joiner +!modules/hw-core/* !modules/acore/* build*/ diff --git a/bin/bash_shared/includes.sh b/bin/bash_shared/includes.sh index bd4e124e2..21e28ff50 100644 --- a/bin/bash_shared/includes.sh +++ b/bin/bash_shared/includes.sh @@ -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 diff --git a/bin/bash_shared/functions.sh b/modules/hw-core/bash-lib-event/src/hooks.sh similarity index 78% rename from bin/bash_shared/functions.sh rename to modules/hw-core/bash-lib-event/src/hooks.sh index 6da557ade..b791a600f 100644 --- a/bin/bash_shared/functions.sh +++ b/modules/hw-core/bash-lib-event/src/hooks.sh @@ -1,5 +1,5 @@ # par 1: hook_name -function runHooks() { +function hwc_event_run_hooks() { hook_name="HOOKS_MAP_$1" read -r -a SRCS <<< ${!hook_name} echo "Running hooks: $hook_name" @@ -9,7 +9,7 @@ function runHooks() { done } -function registerHooks() { +function hwc_event_register_hooks() { hook_name="HOOKS_MAP_$1" hooks=${@:2} declare -g "$hook_name+=$hooks " diff --git a/modules/hw-core/bash-lib-git/bin/git-subtree-list b/modules/hw-core/bash-lib-git/bin/git-subtree-list new file mode 100755 index 000000000..d3af413e9 --- /dev/null +++ b/modules/hw-core/bash-lib-git/bin/git-subtree-list @@ -0,0 +1,7 @@ +#!/bin/bash + +CUR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +source $CUR_DIR"/../src/subtree.sh" + +hwc_git_subtree_list diff --git a/modules/hw-core/bash-lib-git/src/subtree.sh b/modules/hw-core/bash-lib-git/src/subtree.sh new file mode 100644 index 000000000..08820e640 --- /dev/null +++ b/modules/hw-core/bash-lib-git/src/subtree.sh @@ -0,0 +1,3 @@ +function hwc_git_subtree_list() { + git log | grep git-subtree-dir | tr -d ' ' | cut -d ":" -f2 | sort | uniq +}