Last active
October 12, 2018 10:07
-
-
Save elliotthilaire/cef91754bb296d67e776 to your computer and use it in GitHub Desktop.
A pre-push git hooking using the pronto gem
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/sh | |
| # To reinstall this script in the same or another git repo run: | |
| # curl -sSL https://gist.githubusercontent.com/elliotthilaire/cef91754bb296d67e776/raw/pre-push > .git/hooks/pre-push; chmod +x .git/hooks/pre-push | |
| # check that pronto is installed | |
| hash pronto 2>/dev/null || { | |
| echo >&2 "Pronto is not installed. Install with 'gem install pronto pronto-rubocop'"; | |
| echo >&2 "Find other Pronto runners at https://github.com/mmozuras/pronto#runners"; | |
| exit 0; | |
| } | |
| # Run pronto | |
| pronto run --exit-code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note to myself: change
exit 0;toexit 1;for ungit otherwise you won't see the error message if pronto is not installed