summaryrefslogtreecommitdiff
path: root/hooks/pre-commit
blob: b88d7cda7e246a55f122d7bb4e6caa577d737974 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

if [ -z $GIT_DIR ]; then
	echo "Don't run this script from the command line."
	echo "Move this file or set a symbolic link to \".git/hooks/pre-commit\"."
	exit 1
fi

if [ -f $GIT_DIR/../app/Makefile ]; then
	cd "$GIT_DIR/../app"
	make test
	make clean || exit 0
else
	echo "No Makefile found." 1>&2
	exit 1
fi