| 549 | } |
| 550 | |
| 551 | func validateHoursBeforeDelete(ctx context.Context) survey.Validator { |
| 552 | return func(ans any) error { |
| 553 | str, ok := ans.(string) |
| 554 | if !ok { |
| 555 | return errors.New(ctx, "must be a string") |
| 556 | } |
| 557 | i, err := strconv.ParseInt(str, 10, 32) |
| 558 | if err != nil { |
| 559 | return errors.Wrapf(ctx, err, "error parsing hours") |
| 560 | } |
| 561 | if i < 0 { |
| 562 | return errors.New(ctx, "must be positive") |
| 563 | } |
| 564 | return nil |
| 565 | } |
| 566 | } |
| 567 | |
| 568 | func askForConfirmationToAllowReviewAppsFromForks(ctx context.Context, prompt string) (bool, error) { |
| 569 | fmt.Println() |