diff --git a/buildscripts/pre-commit b/buildscripts/pre-commit new file mode 100755 index 0000000..26c6064 --- /dev/null +++ b/buildscripts/pre-commit @@ -0,0 +1,14 @@ +#!/bin/sh + +echo "running cargo check..." + +./check-all.sh +STATUS=$? + +if [ $STATUS -ne 0 ]; then + echo "cargo check failed, aborting" + exit 1 +fi + +echo "cargo check passed" +exit 0 diff --git a/setup-hook.sh b/setup-hook.sh new file mode 100755 index 0000000..04774d6 --- /dev/null +++ b/setup-hook.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +cp buildscripts/pre-commit .git/hooks/