From 45f4aa736599a6e945435567eff5bdd54be3b934 Mon Sep 17 00:00:00 2001 From: Matt Bogosian Date: Tue, 5 Oct 2021 07:46:17 -0500 Subject: [PATCH] fix: back-port fix to properly handle paths with spaces --- entrypoint.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 74232a6..034bd13 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -19,14 +19,7 @@ if [ ! -d "${DIR_TO_SCAN}" ] && [ ! -f "${DIR_TO_SCAN}" ]; then exit 2 fi -ERROR=0 -for file in $(find ${DIR_TO_SCAN} -type f -name "*.php" ! -path "./vendor/*"); do - RESULTS=$(php -l ${file} || true) +find "${DIR_TO_SCAN}" -type f -name '*.php' ! -path './vendor/*' -print0 \ + | xargs -0 -n 1 php -l | (! grep -Ev '^No syntax errors detected in ') - if [ "${RESULTS}" != "No syntax errors detected in ${file}" ]; then - echo "\n${RESULTS}\n" - ERROR=1 - fi -done - -exit "${ERROR}" +exit "${?}"