MCPcopy Create free account
hub / github.com/cli/cli / resolveRepoArg

Function resolveRepoArg

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

Source from the content-addressed store, hash-verified

565}
566
567func 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
588func parseSkillFromOpts(opts *InstallOptions) {
589 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