File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments