mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-19 23:44:17 +00:00
Tests: Make lint.sh a little more useful
This commit is contained in:
parent
b7bd8dc7f1
commit
6e7a693355
@ -1,22 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
PHP_BINARY="php"
|
||||
DIR=""
|
||||
|
||||
while getopts "p:" OPTION 2> /dev/null; do
|
||||
while getopts "p:d:" OPTION 2> /dev/null; do
|
||||
case ${OPTION} in
|
||||
p)
|
||||
PHP_BINARY="$OPTARG"
|
||||
;;
|
||||
d)
|
||||
DIR="$OPTARG"
|
||||
;;
|
||||
esac
|
||||
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
|
||||
echo $OUTPUT | grep -v "No syntax errors"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo Lint scan completed successfully.
|
||||
echo Lint scan completed successfully.
|
||||
|
@ -10,7 +10,7 @@ while getopts "p:" OPTION 2> /dev/null; do
|
||||
esac
|
||||
done
|
||||
|
||||
./tests/lint.sh -p "$PHP_BINARY"
|
||||
./tests/lint.sh -p "$PHP_BINARY" -d ./src/pocketmine
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo Lint scan failed!
|
||||
|
Loading…
x
Reference in New Issue
Block a user