Skip to content

Commit 87025ed

Browse files
committed
Address review comments
Signed-off-by: Vishal Anarase <[email protected]>
1 parent fa96a20 commit 87025ed

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

cli/pkg/workspace/plugin/create.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,9 @@ func (o *CreateWorkspaceOptions) Run(ctx context.Context) error {
240240
createContextOptions := NewCreateContextOptions(o.IOStreams)
241241
createContextOptions.Name = o.CreateContextName
242242
createContextOptions.ClientConfig = o.ClientConfig
243-
createContextOptions.KeepCurrent = false
244243

245-
// If --enter is not set, do not switch to the new context
246-
if !o.EnterAfterCreate {
247-
createContextOptions.KeepCurrent = true
248-
}
244+
// If --enter is set, switch to the new context
245+
createContextOptions.KeepCurrent = !o.EnterAfterCreate
249246

250247
startingConfig, err := o.ClientConfig.RawConfig()
251248
if err != nil {
@@ -265,8 +262,7 @@ func (o *CreateWorkspaceOptions) Run(ctx context.Context) error {
265262
return err
266263
}
267264

268-
err = createContextOptions.Run(ctx)
269-
if err != nil {
265+
if err := createContextOptions.Run(ctx); err != nil {
270266
return fmt.Errorf("failed to create context: %w", err)
271267
}
272268

0 commit comments

Comments
 (0)