Add -f parameter to lint.sh to allow it to not be useless in cygwin

find can conflict with windows' built in find command, which causes it to bug out when running tests.
This commit is contained in:
Dylan K. Taylor 2018-10-05 17:43:45 +01:00
parent 60e1b29462
commit d75c830a7e

View File

@ -2,8 +2,9 @@
PHP_BINARY="php"
DIR=""
FIND="find"
while getopts "p:d:" OPTION 2> /dev/null; do
while getopts "p:d:f:" OPTION 2> /dev/null; do
case ${OPTION} in
p)
PHP_BINARY="$OPTARG"
@ -11,6 +12,9 @@ while getopts "p:d:" OPTION 2> /dev/null; do
d)
DIR="$OPTARG"
;;
f)
FIND="$OPTARG"
;;
esac
done
@ -21,7 +25,7 @@ fi
echo Running PHP lint scans on \"$DIR\"...
OUTPUT=`find "$DIR" -name "*.php" -print0 | xargs -0 -n1 -P4 "$PHP_BINARY" -l`
OUTPUT=`$FIND "$DIR" -name "*.php" -print0 | xargs -0 -n1 -P4 "$PHP_BINARY" -l`
if [ $? -ne 0 ]; then
echo $OUTPUT | grep -v "No syntax errors"