MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / RunSnapshotCreateInteractive

Function RunSnapshotCreateInteractive

tui/snapshot_create.go:367–390  ·  view source on GitHub ↗
(client *api.Client)

Source from the content-addressed store, hash-verified

365}
366
367func RunSnapshotCreateInteractive(client *api.Client) (*SnapshotCreateConfig, error) {
368 InitCommonStyles(os.Stdout)
369 m := NewSnapshotCreateModel(client)
370 p := tea.NewProgram(m)
371 finalModel, err := p.Run()
372 if err != nil {
373 return nil, fmt.Errorf("error running TUI: %w", err)
374 }
375
376 result, ok := finalModel.(snapshotCreateModel)
377 if !ok {
378 return nil, fmt.Errorf("unexpected model type")
379 }
380
381 if result.err != nil {
382 return nil, result.err
383 }
384
385 if result.quitting || !result.config.Confirmed {
386 return nil, ErrCancelled
387 }
388
389 return &result.config, nil
390}

Callers 1

runSnapshotCreateFunction · 0.92

Calls 2

InitCommonStylesFunction · 0.85
NewSnapshotCreateModelFunction · 0.85

Tested by

no test coverage detected