lalles
This commit is contained in:
18
run_local_hook
Normal file
18
run_local_hook
Normal 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
|
||||
Reference in New Issue
Block a user