(skillSource string, canPrompt bool, p prompter.Prompter)
| 578 | } |
| 579 | |
| 580 | func resolveRepoArg(skillSource string, canPrompt bool, p prompter.Prompter) (ghrepo.Interface, string, error) { |
| 581 | if skillSource == "" { |
| 582 | if !canPrompt { |
| 583 | return nil, "", cmdutil.FlagErrorf("must specify a repository to install from") |
| 584 | } |
| 585 | repoInput, err := p.Input("Repository (owner/repo):", "") |
| 586 | if err != nil { |
| 587 | return nil, "", err |
| 588 | } |
| 589 | skillSource = strings.TrimSpace(repoInput) |
| 590 | if skillSource == "" { |
| 591 | return nil, "", fmt.Errorf("must specify a repository to install from") |
| 592 | } |
| 593 | } |
| 594 | repo, err := ghrepo.FromFullName(skillSource) |
| 595 | if err != nil { |
| 596 | return nil, "", cmdutil.FlagErrorf("invalid repository reference %q: expected OWNER/REPO, HOST/OWNER/REPO, or a full URL", skillSource) |
| 597 | } |
| 598 | return repo, skillSource, nil |
| 599 | } |
| 600 | |
| 601 | func parseSkillFromOpts(opts *InstallOptions) { |
| 602 | if opts.SkillName != "" { |
no test coverage detected