Use xargs for syntax check to fail on error

This commit is contained in:
Zach Borboa
2016-09-02 00:40:28 -07:00
parent 1d786ca0d2
commit 976f837499
+2 -2
View File
@@ -1,5 +1,5 @@
# Check syntax in php files.
find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec php -l {} \;
# 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
errors=0