RunFirstTimeSetup runs the first-time setup TUI and returns the result.
(baseDir string, showGitignore bool)
| 757 | |
| 758 | // RunFirstTimeSetup runs the first-time setup TUI and returns the result. |
| 759 | func RunFirstTimeSetup(baseDir string, showGitignore bool) (FirstTimeSetupResult, error) { |
| 760 | setup := NewFirstTimeSetup(baseDir, showGitignore) |
| 761 | p := tea.NewProgram(setup, tea.WithAltScreen()) |
| 762 | |
| 763 | model, err := p.Run() |
| 764 | if err != nil { |
| 765 | return FirstTimeSetupResult{Cancelled: true}, err |
| 766 | } |
| 767 | |
| 768 | if finalSetup, ok := model.(FirstTimeSetup); ok { |
| 769 | return finalSetup.GetResult(), nil |
| 770 | } |
| 771 | |
| 772 | return FirstTimeSetupResult{Cancelled: true}, nil |
| 773 | } |
no test coverage detected