Last active
August 29, 2015 14:19
-
-
Save maephisto/b7ed482fd28182abd879 to your computer and use it in GitHub Desktop.
git prepush hook
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 | |
echo "\nLet me check if you can push this!" | |
echo "\nExecuting unit tests..." | |
testValidationResult=$(grunt test | grep "Done, without errors") | |
if [ "$testValidationResult" != "" ]; then | |
echo "\033[32mUnit tests execution passed. Wow, such tests, much green!\033[0m" | |
else | |
echo "\033[31mUnit tests execution failed. And what do we say to the god of Pu$ | |
exit 1 | |
fi | |
echo "\033[32mPushing...\033[0m" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment