Skip to content

Instantly share code, notes, and snippets.

@asgrim

asgrim/pre-commit

Created Dec 31, 2015
Embed
What would you like to do?
Never commit a broken test again...
#!/bin/bash
echo -n "Running phpunit... "
vendor/bin/phpunit --stop-on-failure --stop-on-error > /dev/null
if [ $? -ne 0 ]
then
echo "[FAILED]"
exit 1
fi
echo "[passed]"
echo -n "Running phpcs... "
vendor/bin/phpcs > /dev/null
if [ $? -ne 0 ]
then
echo "[FAILED]"
exit 1
fi
echo "[passed]"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment