This commit is contained in:
2025-08-04 19:37:17 +02:00
parent bb1781500e
commit 04c72b75d1
2 changed files with 41 additions and 0 deletions

18
run_local_hook Normal file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
echo "Running local hook $1 with params ${@:2}"
# Run local hook if exists
HOOK=$1
#PROJECT_ROOT=$(git rev-parse --show-toplevel)
PROJECT_ROOT=$PWD
if [ -e "$PROJECT_ROOT/hooks/$HOOK" ]; then
echo "Using local $HOOK at $PROJECT_ROOT/hooks/$HOOK in $PROJECT_ROOT"
$PROJECT_ROOT/hooks/$HOOK ${@:2}
INTERNAL_HOOK_EXIT_CODE=$?
echo "Internal hook exited with $INTERNAL_HOOK_EXIT_CODE"
exit $INTERNAL_HOOK_EXIT_CODE
else
exit 0
fi