Move syntax checking to a separate script

This commit is contained in:
Zach Borboa
2021-03-12 20:17:11 -05:00
parent 3fb1838579
commit 78086f03ba
2 changed files with 10 additions and 6 deletions
+9
View File
@@ -0,0 +1,9 @@
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "${SCRIPT_DIR}"
# Check syntax in php files. Use `xargs' over `find -exec' as xargs exits with a value of 1 when any command errors.
find .. -type "f" -iname "*.php" ! -path "*/vendor/*" | xargs -L "1" php -l
if [[ "${?}" -ne 0 ]]; then
echo "Error: php syntax checks failed"
((errors++))
fi
+1 -6
View File
@@ -5,12 +5,7 @@ export PATH="${PWD}/vendor/bin:${PATH}"
errors=0
# Check syntax in php files. Use `xargs' over `find -exec' as xargs exits with a value of 1 when any command errors.
find . -type "f" -iname "*.php" ! -path "*/vendor/*" | xargs -L "1" php -l
if [[ "${?}" -ne 0 ]]; then
echo "Error: php syntax checks failed"
((errors++))
fi
source "check_syntax.sh"
# Let test server know we should allow testing.
export PHP_CURL_CLASS_TEST_MODE_ENABLED="yes"