Skip to content

Commit

Permalink
HAI Fix for githooks
Browse files Browse the repository at this point in the history
  • Loading branch information
corvidian committed Sep 7, 2023
1 parent f98dfdc commit 4e3790c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 6 additions & 5 deletions githooks/pre-push
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/bin/sh
#!/bin/bash

hooks="$(dirname "$0")/pre-push.d"

for hook in ${hooks}/*; do
bash $hook
echo "Running $hook."
bash "${hook}"
RESULT=$?
if [ $RESULT != 0 ]; then
echo "pre-push.d/$hook returned non-zero: $RESULT, abort push"
exit $RESULT
if [[ ${RESULT} != 0 ]]; then
echo "${hook} returned non-zero: ${RESULT}, abort push"
exit ${RESULT}
fi
done

Expand Down
2 changes: 2 additions & 0 deletions services/hanke-service/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ tasks {
}

tasks.register("installGitHook", Copy::class) {
group = "other"
description = "Installs shared git hooks"
from(file("$rootDir/githooks"))
into(file("$rootDir/.git/hooks"))
fileMode = 0b0111101101 // -rwxr-xr-x
Expand Down

0 comments on commit 4e3790c

Please sign in to comment.