Skip to content

Commit

Permalink
Restore pre-commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shyue Ping Ong committed Aug 1, 2012
1 parent 5321339 commit ca7c0c3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions 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.