Skip to content

Commit

Permalink
fix: properly handle paths with spaces (#7)
Browse files Browse the repository at this point in the history
Fixes #6.
  • Loading branch information
posita authored Oct 5, 2021
1 parent 77bebd4 commit 9e836d2
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 9e836d2

Please sign in to comment.