(m createModel)
| 1146 | } |
| 1147 | |
| 1148 | func runCreateModel(m createModel) (*CreateConfig, error) { |
| 1149 | p := tea.NewProgram(m) |
| 1150 | finalModel, err := p.Run() |
| 1151 | if err != nil { |
| 1152 | return nil, fmt.Errorf("error running TUI: %w", err) |
| 1153 | } |
| 1154 | |
| 1155 | result, ok := finalModel.(createModel) |
| 1156 | if !ok { |
| 1157 | return nil, fmt.Errorf("unexpected model type") |
| 1158 | } |
| 1159 | |
| 1160 | if result.err != nil { |
| 1161 | return nil, result.err |
| 1162 | } |
| 1163 | |
| 1164 | if result.quitting || !result.config.Confirmed { |
| 1165 | return nil, ErrCancelled |
| 1166 | } |
| 1167 | |
| 1168 | return &result.config, nil |
| 1169 | } |
| 1170 | |
| 1171 | func RunCreateInteractive(client *api.Client, specs *utils.SpecStore) (*CreateConfig, error) { |
| 1172 | InitCommonStyles(os.Stdout) |
no outgoing calls
no test coverage detected