From 3d10177dbc4407471eb2c7bfcfcf270157054be3 Mon Sep 17 00:00:00 2001 From: Marcin Dobosz Date: Fri, 18 Mar 2022 11:26:29 -0700 Subject: [PATCH] fix: revert "Pass through arguments to terraform sub commands (#186)" (#242) This reverts commit 1783e60c176018afea37ff2ba94f6fd7afb678ce. --- terraform-actions/main.sh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/terraform-actions/main.sh b/terraform-actions/main.sh index 1c695e3..ad5ea50 100755 --- a/terraform-actions/main.sh +++ b/terraform-actions/main.sh @@ -12,9 +12,6 @@ export TF_IN_AUTOMATION=true workingDir="$2" function main { command="$1" - firstWord=$(echo ${command} | cut -d' ' -f1) - remainingArgs=$(echo ${command} | cut -d' ' -f2-) - scriptDir=$(dirname ${0}) source ${scriptDir}/apply.sh source ${scriptDir}/fmt.sh @@ -22,21 +19,21 @@ function main { source ${scriptDir}/plan.sh source ${scriptDir}/validate.sh - case "${firstWord}" in + case "${command}" in apply) - terraformApply ${remainingArgs} + terraformApply ;; fmt) - terraformFmt ${remainingArgs} + terraformFmt ;; init) - terraformInit ${remainingArgs} + terraformInit ;; plan) - terraformPlan ${remainingArgs} + terraformPlan ;; validate) - terraformValidate ${remainingArgs} + terraformValidate ;; *) echo "Error: Unrecognized command ${command}"