vars.sh: Fix issue when .git/hooks does not exist
Nicolas Braud-Santoni
5 years ago
2 | 2 |
|
3 | 3 |
abort() { local x=$1; shift; for i in "$@"; do echo >&2 "$0: abort: $i"; done; exit "$x"; }
|
4 | 4 |
|
|
5 |
mkdir -p "$(dirname "$0")/.git/hooks"
|
5 | 6 |
HOOK_COMMIT="$(dirname "$0")/.git/hooks/pre-commit"
|
6 | 7 |
if [ ! -x "$HOOK_COMMIT" ]; then
|
7 | 8 |
cat <<'eof' >"$HOOK_COMMIT"
|