Skip to content

Commit

Permalink
Implement default to run on every Puppet manifest individually
Browse files Browse the repository at this point in the history
  • Loading branch information
Ira W. Snyder committed Mar 31, 2020
1 parent 9f6e742 commit 0ba8059
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0ba8059

Please sign in to comment.