Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions commit_hooks/r10k_syntax_check.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#!/bin/bash
#
# This script assumes you have installed r10k and will perform a syntax check on the Puppetfile if existing
old_dir=$PWD
pf_dir=$(dirname $1)

echo "Performing a syntax check on the r10k Puppetfile:"
PUPPETFILE="$1" r10k puppetfile check
cd $pf_dir && r10k puppetfile check

if [[ $? -ne 0 ]]
then
exit 1
cd $old_dir
exit 1
fi

cd $old_dir
exit 0