File: install-git-hook.sh

package info (click to toggle)
goodvibes 0.8.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,784 kB
  • sloc: ansic: 16,310; sh: 978; python: 21; makefile: 19
file content (13 lines) | stat: -rwxr-xr-x 328 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash

set -e
set -u

cd "$MESON_SOURCE_ROOT"

[ -d .git ] || exit 0 # not a git repo
[ -f .git/hooks/pre-commit.sample ] || exit 0 # doesn't hurt to check
[ ! -f .git/hooks/pre-commit ] || exit 0 # already installed

install -m 0755 .git/hooks/pre-commit.sample .git/hooks/pre-commit
echo 'Git pre-commit hook installed'