diff --git a/githooks/pre-push b/githooks/pre-push index 5c103c726..0c0ea9da7 100644 --- a/githooks/pre-push +++ b/githooks/pre-push @@ -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 diff --git a/services/hanke-service/build.gradle.kts b/services/hanke-service/build.gradle.kts index 1c4a2f1ec..35c63ab82 100644 --- a/services/hanke-service/build.gradle.kts +++ b/services/hanke-service/build.gradle.kts @@ -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