File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed
Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -549,11 +549,34 @@ func createAction(cmd *cobra.Command, args []string) error {
549549 if len (inst .Errors ) > 0 {
550550 return fmt .Errorf ("errors inspecting instance: %+v" , inst .Errors )
551551 }
552- if _ , err = instance .Prepare (cmd .Context (), inst , "" ); err != nil {
552+ ctx := cmd .Context ()
553+ if _ , err = instance .Prepare (ctx , inst , "" ); err != nil {
554+ return err
555+ }
556+ tty , err := cmd .Flags ().GetBool ("tty" )
557+ if err != nil {
558+ return err
559+ }
560+
561+ startNow := false
562+ if tty {
563+ startNow , err = askWhetherToStart ()
564+ if err != nil {
565+ return err
566+ }
567+ }
568+
569+ if ! startNow {
570+ logrus .Infof ("Run `limactl start %s` to start the instance." , inst .Name )
571+ return nil
572+ }
573+
574+ if err := instance .Start (ctx , inst , false , false ); err != nil {
553575 return err
554576 }
555- logrus . Infof ( "Run `limactl start %s` to start the instance." , inst . Name )
577+
556578 return nil
579+
557580}
558581
559582func startAction (cmd * cobra.Command , args []string ) error {
You can’t perform that action at this time.
0 commit comments