ref: 3d9e1a3f0c32c7f731b00330e0a8b8c4ce696250 mousikofidi/pre-commit.sh -rwxr-xr-x 354 bytes View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

set -e

export LANG=en_US.UTF-8

arg="${1}"
here=$(realpath $(dirname ${0}))

if [ "${arg}" = "--install" ]; then
    if ! [ "$(readlink ${here}/.git/hooks/pre-commit)" = "../../pre-commit.sh" ]; then
        cd "${here}"/.git/hooks
        ln -fsv ../../pre-commit.sh ./pre-commit
    fi
    exit
fi

cd "${here}"/../../

make test-verbose