Skip to content

Commit

Permalink
fix: back-port fix to properly handle paths with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
posita authored Oct 5, 2021
1 parent 3597054 commit 45f4aa7
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "${?}"

0 comments on commit 45f4aa7

Please sign in to comment.