Last active
July 22, 2021 08:21
-
-
Save ChrisMarxDev/dfc022dd7c268c69381a6d0e9411b28d to your computer and use it in GitHub Desktop.
Flutter pre-push git hook. Does not push if analyse or test fail.
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 use add to your projects `.git/hooks/` | |
# Should be named `pre-push` | |
# Don't forget to make it executable with `chmod +x` | |
# run Flutter analyze + test | |
flutter analyze | |
if [ $? -ne 0 ]; then | |
exit 1 | |
fi | |
flutter test | |
if [ $? -ne 0 ]; then | |
exit 1 | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment