File: pre-commit.in

package info (click to toggle)
kf6-extra-cmake-modules 6.22.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,608 kB
  • sloc: python: 668; cpp: 330; ansic: 291; xml: 182; sh: 62; makefile: 8
file content (25 lines) | stat: -rwxr-xr-x 550 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env bash

${PRE_COMMIT_SCRIPTS}

RESULT=$?
if [ $RESULT != 0 ]; then
    exit $RESULT
fi

# If the user has custom commit hooks defined in pre-commit.d directory,
# execute them
PRE_COMMIT_D_DIR="$(dirname "$0")/pre-commit.d/"

if [ -d "$PRE_COMMIT_D_DIR" ]; then
    for PRE_COMMIT_D_HOOK in "$PRE_COMMIT_D_DIR"/*; do
        ./"$PRE_COMMIT_D_HOOK"
        RESULT=$?
        if [ $RESULT != 0 ]; then
            echo "$PRE_COMMIT_D_HOOK returned non-zero: $RESULT, commit aborted"
            exit $RESULT
        fi
    done
fi

exit 0