Created
November 13, 2013 13:03
-
-
Save chadrien/7448765 to your computer and use it in GitHub Desktop.
Git hooks for everyday PHP developer
This file contains 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 | |
git stash >/dev/null | |
# if tests fail, do not push | |
exit_with_status() { | |
git pop >/dev/null | |
exit "$1" | |
} | |
TEST_COMMANDS=( | |
) | |
for TEST_COMMAND in "${TEST_COMMANDS[@]}"; do | |
$TEST_COMMAND | |
if [[ "0" != "$?" ]]; then | |
echo "lol nope" | |
exit_with_status 1 | |
fi | |
done | |
exit_with_status 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment