34 lines
600 B
Bash
Raw Normal View History

2017-09-11 12:34:58 -04:00
#!/bin/bash
error=false
while test $# -gt 0; do
current=$1
shift
if [ ! -d $current ] && [ ! -f $current ] ; then
echo "Invalid directory or file: $current"
error=true
continue
fi
2017-11-06 12:38:48 -05:00
for file in `find $current -type f -not -path "*vendor/phpunit/*" -not -path "*/api/Tests/*" -name "*.php"` ; do
2017-09-11 12:34:58 -04:00
RESULTS=`php -l $file`
echo $RESULTS
if [ "$RESULTS" != "No syntax errors detected in $file" ] ; then
echo $RESULTS
error=true
fi
done
done
if [ "$error" = true ] ; then
exit 1
else
exit 0
fi