File: configure-hooks.sh

package info (click to toggle)
docker-registry 2.8.1%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,148 kB
  • sloc: sh: 331; makefile: 82
file content (18 lines) | stat: -rwxr-xr-x 413 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

cd $(dirname $0)

REPO_ROOT=$(git rev-parse --show-toplevel)
RESOLVE_REPO_ROOT_STATUS=$?
if [ "$RESOLVE_REPO_ROOT_STATUS" -ne "0" ]; then
	echo -e "Unable to resolve repository root. Error:\n$REPO_ROOT" > /dev/stderr
	exit $RESOLVE_REPO_ROOT_STATUS
fi

set -e
set -x

# Just in case the directory doesn't exist
mkdir -p $REPO_ROOT/.git/hooks

ln -f -s $(pwd)/pre-commit $REPO_ROOT/.git/hooks/pre-commit