Skip to content

Instantly share code, notes, and snippets.

@Bigomby
Created July 15, 2016 09:17
Show Gist options
  • Save Bigomby/5949dc08e5b7067f2d00a959c5e556e5 to your computer and use it in GitHub Desktop.
Save Bigomby/5949dc08e5b7067f2d00a959c5e556e5 to your computer and use it in GitHub Desktop.
Pre commit hook to verify an app pass tests
#!/bin/sh
# stash any unstaged changes
git stash -q --keep-index
# run the tests
make tests
# store the last exit code in a variable
RESULT=$?
# unstash the unstashed changes
git stash pop -q
# return the exit code
exit $RESULT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment