Added Quiet value (#32116)

* Added Quiet value

* Added Quiet value

* Added Quiet value

* Removed comments on 170 171 173

Co-authored-by: itspooya <fallenangel201190@gmail.com>
This commit is contained in:
Pooya 2023-01-25 19:51:14 +03:00 committed by GitHub
parent 29b8a07105
commit 6bbb76eca3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()