cli: show workspace name in destroy confirmation (#18253)

* cli: show workspace name in destroy confirmation

If the workspace name is not "default", include it in the confirmation
message for `terraform destroy`.

Fixes #15480
pull/18093/head
Kristin Laemmert 8 years ago committed by GitHub
parent b95f74956a
commit 85be12d783
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -84,14 +84,21 @@ func (b *Local) opApply(
if mustConfirm {
var desc, query string
if op.Destroy {
// Default destroy message
if op.Workspace != "default" {
query = "Do you really want to destroy all resources in workspace \"" + op.Workspace + "\"?"
} else {
query = "Do you really want to destroy all resources?"
}
desc = "Terraform will destroy all your managed infrastructure, as shown above.\n" +
"There is no undo. Only 'yes' will be accepted to confirm."
query = "Do you really want to destroy?"
} else {
if op.Workspace != "default" {
query = "Do you want to perform these actions in workspace \"" + op.Workspace + "\"?"
} else {
query = "Do you want to perform these actions?"
}
desc = "Terraform will perform the actions described above.\n" +
"Only 'yes' will be accepted to approve."
query = "Do you want to perform these actions?"
}
if !trivialPlan {

Loading…
Cancel
Save