mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 09:37:26 +00:00
better syntax check
This commit is contained in:
parent
56e58f2a29
commit
744c9848d1
1 changed files with 12 additions and 1 deletions
|
@ -1,7 +1,18 @@
|
|||
#!/bin/bash
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
ERRORS=0
|
||||
|
||||
for FILE in $(find "$DIR" -name '*.php'); do
|
||||
php7.0 -l $FILE
|
||||
CHECK=$(php7.0 -l $FILE | grep -v "^No syntax errors detected")
|
||||
if [ -n "$CHECK" ]; then
|
||||
echo "$CHECK"
|
||||
ERRORS=1
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $ERRORS -eq 0 ]; then
|
||||
echo "Syntax OK"
|
||||
fi
|
||||
|
||||
exit $ERRORS
|
||||
|
|
Loading…
Add table
Reference in a new issue