From 62a63102927b08cc51b60ca38f396ef86eb70108 Mon Sep 17 00:00:00 2001 From: mihirhasan Date: Thu, 29 Jul 2021 23:35:38 -0700 Subject: [PATCH] Update pre-commit-hook.sh --- scripts/pre-commit-hook.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/pre-commit-hook.sh b/scripts/pre-commit-hook.sh index c77d2e02c..48036eacb 100644 --- a/scripts/pre-commit-hook.sh +++ b/scripts/pre-commit-hook.sh @@ -18,11 +18,16 @@ terrascan_() { let "index+=1" done - + #put arguments array into runnable string + PARAMS = '' + for i in "${arr[@]}" + do + PARAMS= "${PARAMS} ${i}" + done + echo $PARAMS for path_uniq in $(echo "${paths[*]}" | tr ' ' '\n' | sort -u); do path_uniq="${path_uniq//__REPLACED__SPACE__/ }" pushd "$path_uniq" > /dev/null - echo 'args' ${ARGS[*]} terrascan scan $ARGS popd > /dev/null done