(message string, action func() error)
| 174 | } |
| 175 | |
| 176 | func RunUpdateProgress(message string, action func() error) error { |
| 177 | InitCommonStyles(os.Stdout) |
| 178 | m := newUpdateProgressModel(message, action) |
| 179 | p := tea.NewProgram(m) |
| 180 | finalModel, err := p.Run() |
| 181 | if err != nil { |
| 182 | return fmt.Errorf("error running update progress: %w", err) |
| 183 | } |
| 184 | |
| 185 | result, ok := finalModel.(updateProgressModel) |
| 186 | if !ok { |
| 187 | return fmt.Errorf("unexpected model type") |
| 188 | } |
| 189 | if result.err != nil { |
| 190 | return result.err |
| 191 | } |
| 192 | |
| 193 | return nil |
| 194 | } |
nothing calls this directly
no test coverage detected