Created
July 20, 2011 18:34
-
-
Save jondavidjohn/1095578 to your computer and use it in GitHub Desktop.
Bash Alias to check for php errors on all Modified Files
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
function gitphpcheck () { | |
filearray=() | |
while read line; do | |
if [[ $line =~ ^(M|N) ]] | |
then | |
filename="`echo $line | awk '{ print $2 }'`" | |
filearray+=($filename) | |
fi | |
done < <(git diff --name-status) | |
for file in ${filearray[*]} | |
do | |
php -l $file | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment