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