From 4464e13e55889a4de717c6c8a39a833fa268f58c Mon Sep 17 00:00:00 2001 From: Maksym Vlasov Date: Fri, 25 Nov 2022 19:59:54 +0200 Subject: [PATCH] Stop execution if more than one flag specified --- hooks/terraform_validate.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hooks/terraform_validate.sh b/hooks/terraform_validate.sh index 37eee6262..869de7f93 100755 --- a/hooks/terraform_validate.sh +++ b/hooks/terraform_validate.sh @@ -95,6 +95,10 @@ function per_dir_hook_unique_part { case $key in --retry-once-with-cleanup) + if [ $retry_once_with_cleanup ]; then + common::colorify "yellow" 'Invalid hook config. Make sure that you specify not more than one "--retry-once-with-cleanup" flag' + exit 1 + fi retry_once_with_cleanup=$value ;; esac