Create a gist now

Instantly share code, notes, and snippets.

Before you push hook for svg.js
#!/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
@dotnetCarpenter
Owner

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.

@dotnetCarpenter
Owner

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