Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape characters for workspace selection #403

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions tfexec/workspace_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ func (tf *Terraform) workspaceDeleteCmd(ctx context.Context, workspace string, o
args = append(args, "-lock="+strconv.FormatBool(c.lock))
}

args = append(args, "--")
args = append(args, workspace)

cmd := tf.buildTerraformCmd(ctx, nil, args...)
Expand Down
1 change: 1 addition & 0 deletions tfexec/workspace_new.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func (tf *Terraform) workspaceNewCmd(ctx context.Context, workspace string, opts
args = append(args, "-state="+c.copyState)
}

args = append(args, "--")
args = append(args, workspace)

cmd := tf.buildTerraformCmd(ctx, nil, args...)
Expand Down
2 changes: 1 addition & 1 deletion tfexec/workspace_select.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ import "context"
func (tf *Terraform) WorkspaceSelect(ctx context.Context, workspace string) error {
// TODO: [DIR] param option

return tf.runTerraformCmd(ctx, tf.buildTerraformCmd(ctx, nil, "workspace", "select", "-no-color", workspace))
return tf.runTerraformCmd(ctx, tf.buildTerraformCmd(ctx, nil, "workspace", "select", "-no-color", "--", workspace))
}