Skip to content
Browse files

Restore pre-commit.

  • Loading branch information...
1 parent 5321339 commit ca7c0c3e13a3e5e63d0a6a97a7d8784efb12f745 Shyue Ping Ong committed Aug 1, 2012
Showing with 18 additions and 0 deletions.
  1. +18 −0 example-hooks/pre-commit
View
18 example-hooks/pre-commit
@@ -0,0 +1,18 @@
+#!/bin/sh
+#
+# An example hook script to verify what is about to be committed.
+# Called by "git commit" with no arguments. The hook should
+# exit with non-zero status after issuing an appropriate message if
+# it wants to stop the commit.
+#
+# To enable this hook, rename this file to "pre-commit".
+
+#running nose-tests
+echo "Running nose tests. Please wait..."
+nose_output=`nosetests --with-doctest 2>&1`
+error=`echo "$nose_output" | grep Error`
+if [ "$error" != "" ]; then
+ echo "pymatgen nosetest has errors. Error log: $nose_output"
+ exit 1
+fi
+echo "pymatgen nosetest passed. Log: $nose_output"

0 comments on commit ca7c0c3

Please sign in to comment.
Something went wrong with that request. Please try again.