Last active
November 13, 2016 10:49
-
-
Save dotnetCarpenter/bb6c2f040e11922cc8f81ef42a8054fd to your computer and use it in GitHub Desktop.
Before you push hook for svg.js
This file contains 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/sh | |
npm run build:test && npm run test:quick | |
# check how the test went | |
testCode=$? | |
[ "$testCode" = 0 ] || echo "Your current build does not pass our unit tests - please make them pass before you push" | |
# revert artifacts created during build | |
git reset --hard $(git log -1 --pretty=%H) | |
# exit with the test exit code | |
exit $testCode |
To disable the check write git push --no-verify
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Put this file in your local svg.js repository, in the .git/hooks folder and make it executable
sudo chmod +x .git/hooks/pre-push
.