Created
December 12, 2016 14:58
-
-
Save kimniche/4c0493c4c09db55f7e143740e1a3687a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # First confirm we actually have commits to push | |
| commits=`git log @{u}..` | |
| if [ -z "$commits" ]; then | |
| exit 0 | |
| fi | |
| # Get OX-specific test command | |
| # Assume not Mac OSX by default | |
| CMD="npm run test:nowatch-win" | |
| if [[ $OSTYPE == darwin* ]]; then | |
| CMD="npm run test:nowatch" | |
| fi | |
| echo "[pre-push] Running tests with \`$CMD\`" | |
| $CMD | |
| RESULT=$? | |
| if [ $RESULT -ne 0 ]; then | |
| echo "[pre-push] Some tests failed, not pushing" | |
| exit 1 | |
| fi | |
| # Exit status code 1 is error and will prevent push | |
| exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment