From 89d3c53fadfd6419c8c6e43af8ace7707deec012 Mon Sep 17 00:00:00 2001 From: Jez Ng Date: Fri, 2 Nov 2012 23:36:13 -0400 Subject: Fix pre-commit hook. Previously, we were running the tests based on the working directory code (instead of using the index), and we did not check that the generated JS matched the latest Coffeescript. --- git_hooks/pre-commit | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'git_hooks') diff --git a/git_hooks/pre-commit b/git_hooks/pre-commit index 4c618746..f8dacac2 100755 --- a/git_hooks/pre-commit +++ b/git_hooks/pre-commit @@ -1,5 +1,7 @@ #!/bin/sh +echo "Preparing to run tests..." + TDIR=`mktemp -d -t vimium` if [ $? -ne 0 ] @@ -8,10 +10,16 @@ then fi git checkout-index --prefix=$TDIR/ -af +# because submodules don't get picked up by checkout-index +cp -r ./tests/shoulda.js/ $TDIR/tests/shoulda.js/ -cake test +pushd $TDIR > /dev/null + cake build + cake test + TEST_RESULT=$? +popd -TEST_RESULT=$? +echo "Tests completed." rm -rf $TDIR -- cgit v1.2.3