mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-11 12:27:51 +00:00
Tests: Make lint.sh a little more useful
This commit is contained in:
parent
b7bd8dc7f1
commit
6e7a693355
@ -1,18 +1,27 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
PHP_BINARY="php"
|
PHP_BINARY="php"
|
||||||
|
DIR=""
|
||||||
|
|
||||||
while getopts "p:" OPTION 2> /dev/null; do
|
while getopts "p:d:" OPTION 2> /dev/null; do
|
||||||
case ${OPTION} in
|
case ${OPTION} in
|
||||||
p)
|
p)
|
||||||
PHP_BINARY="$OPTARG"
|
PHP_BINARY="$OPTARG"
|
||||||
;;
|
;;
|
||||||
|
d)
|
||||||
|
DIR="$OPTARG"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
echo Running PHP lint scans...
|
if [ "$DIR" == "" ]; then
|
||||||
|
echo No directory specified
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
OUTPUT=`find ./src/pocketmine -name "*.php" -print0 | xargs -0 -n1 -P4 "$PHP_BINARY" -l`
|
echo Running PHP lint scans on \"$DIR\"...
|
||||||
|
|
||||||
|
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"
|
||||||
|
@ -10,7 +10,7 @@ while getopts "p:" OPTION 2> /dev/null; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
./tests/lint.sh -p "$PHP_BINARY"
|
./tests/lint.sh -p "$PHP_BINARY" -d ./src/pocketmine
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo Lint scan failed!
|
echo Lint scan failed!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user