From 976f8374999a0ff3a7f549fb64ccc5154ec50fa3 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Fri, 2 Sep 2016 00:40:28 -0700 Subject: [PATCH] Use xargs for syntax check to fail on error --- tests/script.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/script.sh b/tests/script.sh index 0621b02..507cbce 100755 --- a/tests/script.sh +++ b/tests/script.sh @@ -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