Skip to content

Instantly share code, notes, and snippets.

@elliotthilaire
Last active October 12, 2018 10:07
Show Gist options
  • Save elliotthilaire/cef91754bb296d67e776 to your computer and use it in GitHub Desktop.
Save elliotthilaire/cef91754bb296d67e776 to your computer and use it in GitHub Desktop.
A pre-push git hooking using the pronto gem
#!/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
@ylecuyer
Copy link

Note to myself: change exit 0; to exit 1; for ungit otherwise you won't see the error message if pronto is not installed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment