Last active
May 2, 2017 18:49
-
-
Save mitalcoi/407437aa57b6b4ae84f0131e023e8d64 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/bash | |
echo "php-cs-fixer pre commit hook start" | |
PHP_CS_FIXER="php-cs-fixer" | |
git status --porcelain | grep -e '^[AM]\(.*\).php$' | cut -c 3- | while read line; do | |
$PHP_CS_FIXER fix --verbose "$line"; | |
git add "$line"; | |
done | |
echo "php-cs-fixer pre commit hook finish" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment