Created
February 21, 2014 15:07
-
-
Save seqizz/9135843 to your computer and use it in GitHub Desktop.
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 | |
USRHOMEDIR=`echo $(cd ~)`/ | |
FIXER=php-cs-fixer.phar | |
PROJECTROOT="$1" | |
if [ ! -e ${USRHOMEDIR}${FIXER} ]; then | |
echo "PHP-CS-Fixer not available, downloading to ${USRHOMEDIR}${FIXER}..." | |
curl -s http://cs.sensiolabs.org/get/$FIXER > ${USRHOMEDIR}${FIXER} | |
echo "Done. First time to check the Coding Standards." | |
echo "" | |
fi | |
RES=`php ${USRHOMEDIR}${FIXER} fix $PROJECTROOT --verbose --dry-run` | |
if [ "$RES" != "" ]; then | |
echo "Coding standards are not correct, cancelling your commit." | |
echo "" | |
echo $RES | |
echo "" | |
echo "If you want to fix them run:" | |
echo "" | |
echo " php ${USRHOMEDIR}${FIXER} fix ${PROJECTROOT} --verbose" | |
echo "" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment