Skip to content

Instantly share code, notes, and snippets.

@sixertoy
Created May 2, 2016 09:14
Show Gist options
  • Save sixertoy/9be3d95f96351599b8f4d6332e5b2fbf to your computer and use it in GitHub Desktop.
Save sixertoy/9be3d95f96351599b8f4d6332e5b2fbf to your computer and use it in GitHub Desktop.
GIT hook run tests before push
#!/bin/bash
# ----------------------------------
#
# pre-push hook running tests
#
git stash -q --keep-index
# NodeJS project
npm test
RESULT=$?
git stash pop -q
[ $RESULT -ne 0 ] && exit 1
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment