diff --git a/entrypoint.sh b/entrypoint.sh index c98c608..51d2e37 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,5 +2,10 @@ set -euo pipefail -echo "ARGUMENTS: $@" -exec /opt/puppetlabs/bin/puppet parser validate "$@" +if [[ "$#" -eq "1" ]]; then + # No arguments given, run the syntax checker on every Puppet manifest in the current directory + /usr/bin/find . -iname '*.pp' -type f -print0 | xargs -0 /opt/puppetlabs/bin/puppet parser validate +else + # Run the syntax checker on the given files / directories + exec /opt/puppetlabs/bin/puppet parser validate "$@" +fi