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

Function resolveRepoArg

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

Source from the content-addressed store, hash-verified

578}
579
580func 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
601func parseSkillFromOpts(opts *InstallOptions) {
602 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