From d227466558ec415042bb6f69b0baf84eec5a1d2e Mon Sep 17 00:00:00 2001 From: Laura Macchi Date: Tue, 13 Mar 2018 10:25:29 -0500 Subject: [PATCH] Env vars were removed from r10k --- commit_hooks/r10k_syntax_check.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/commit_hooks/r10k_syntax_check.sh b/commit_hooks/r10k_syntax_check.sh index b820eb9..32e3a13 100755 --- a/commit_hooks/r10k_syntax_check.sh +++ b/commit_hooks/r10k_syntax_check.sh @@ -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