From 0ba80598cf384771f6c4066e2a537bf5f69a2bb4 Mon Sep 17 00:00:00 2001 From: "Ira W. Snyder" Date: Tue, 31 Mar 2020 12:32:41 -0700 Subject: [PATCH] Implement default to run on every Puppet manifest individually --- entrypoint.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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