Skip to content

Instantly share code, notes, and snippets.

@jondavidjohn
Created July 20, 2011 18:34
Show Gist options
  • Save jondavidjohn/1095578 to your computer and use it in GitHub Desktop.
Save jondavidjohn/1095578 to your computer and use it in GitHub Desktop.
Bash Alias to check for php errors on all Modified Files
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