(skillSource string, canPrompt bool, p prompter.Prompter)
| 565 | } |
| 566 | |
| 567 | func resolveRepoArg(skillSource string, canPrompt bool, p prompter.Prompter) (ghrepo.Interface, string, error) { |
| 568 | if skillSource == "" { |
| 569 | if !canPrompt { |
| 570 | return nil, "", cmdutil.FlagErrorf("must specify a repository to install from") |
| 571 | } |
| 572 | repoInput, err := p.Input("Repository (owner/repo):", "") |
| 573 | if err != nil { |
| 574 | return nil, "", err |
| 575 | } |
| 576 | skillSource = strings.TrimSpace(repoInput) |
| 577 | if skillSource == "" { |
| 578 | return nil, "", fmt.Errorf("must specify a repository to install from") |
| 579 | } |
| 580 | } |
| 581 | repo, err := ghrepo.FromFullName(skillSource) |
| 582 | if err != nil { |
| 583 | return nil, "", cmdutil.FlagErrorf("invalid repository reference %q: expected OWNER/REPO, HOST/OWNER/REPO, or a full URL", skillSource) |
| 584 | } |
| 585 | return repo, skillSource, nil |
| 586 | } |
| 587 | |
| 588 | func parseSkillFromOpts(opts *InstallOptions) { |
| 589 | if opts.SkillName != "" { |
no test coverage detected