MCPcopy
hub / github.com/cli/cli / resolveRepoArg

Function resolveRepoArg

pkg/cmd/skills/install/install.go:575–594  ·  view source on GitHub ↗
(skillSource string, canPrompt bool, p prompter.Prompter)

Source from the content-addressed store, hash-verified

573}
574
575func 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
596func parseSkillFromOpts(opts *InstallOptions) {
597 if opts.SkillName != "" {

Callers 1

installRunFunction · 0.85

Calls 4

FlagErrorfFunction · 0.92
FromFullNameFunction · 0.92
InputMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected