From 6bbb76eca3a118e76cc4c95f9c21b61d381efcac Mon Sep 17 00:00:00 2001 From: Pooya Date: Wed, 25 Jan 2023 19:51:14 +0300 Subject: [PATCH] Added Quiet value (#32116) * Added Quiet value * Added Quiet value * Added Quiet value * Removed comments on 170 171 173 Co-authored-by: itspooya --- .../provisioners/local-exec/resource_provisioner.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/builtin/provisioners/local-exec/resource_provisioner.go b/internal/builtin/provisioners/local-exec/resource_provisioner.go index 5a1dc04f23..650472c23e 100644 --- a/internal/builtin/provisioners/local-exec/resource_provisioner.go +++ b/internal/builtin/provisioners/local-exec/resource_provisioner.go @@ -57,6 +57,10 @@ func (p *provisioner) GetSchema() (resp provisioners.GetSchemaResponse) { Type: cty.Map(cty.String), Optional: true, }, + "quiet": { + Type: cty.Bool, + Optional: true, + }, }, } @@ -163,7 +167,11 @@ func (p *provisioner) ProvisionResource(req provisioners.ProvisionResourceReques go copyUIOutput(req.UIOutput, tee, copyDoneCh) // Output what we're about to run - req.UIOutput.Output(fmt.Sprintf("Executing: %q", cmdargs)) + if quietVal := req.Config.GetAttr("quiet"); !quietVal.IsNull() && quietVal.True() { + req.UIOutput.Output("local-exec: Executing: Suppressed by quiet=true") + } else { + req.UIOutput.Output(fmt.Sprintf("Executing: %q", cmdargs)) + } // Start the command err = cmd.Start()