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