2019-01-08 16:22:43 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Runs a simple check before pushing. In particular, this checks
|
|
|
|
# if templates were regenerated and style is correct.
|
|
|
|
# Put this file to `.git/hooks/`.
|
|
|
|
|
|
|
|
echo "Running pre-push git hook."
|
|
|
|
|
|
|
|
# Runs check for common simple errors before pushing
|
|
|
|
if ! make templates_check &> /dev/null
|
|
|
|
then
|
|
|
|
echo >&2 "Templates not updated, run 'make templates'. Not pushing."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-01-17 13:51:16 +00:00
|
|
|
if ! make style_check &> /dev/null
|
2019-01-08 16:22:43 +00:00
|
|
|
then
|
|
|
|
echo >&2 "Style invalid, run style make commands. Not pushing."
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "pre-push hook passed. Pushing."
|