MCPcopy
hub / github.com/cli/cli / isBinExtension

Function isBinExtension

pkg/cmd/extension/manager.go:743–765  ·  view source on GitHub ↗
(client *http.Client, repo ghrepo.Interface)

Source from the content-addressed store, hash-verified

741}
742
743func isBinExtension(client *http.Client, repo ghrepo.Interface) (isBin bool, err error) {
744 var r *release
745 r, err = fetchLatestRelease(client, repo)
746 if err != nil {
747 return
748 }
749
750 for _, a := range r.Assets {
751 dists := possibleDists()
752 for _, d := range dists {
753 suffix := d
754 if strings.HasPrefix(d, "windows") {
755 suffix += ".exe"
756 }
757 if strings.HasSuffix(a.Name, suffix) {
758 isBin = true
759 break
760 }
761 }
762 }
763
764 return
765}
766
767func repoFromPath(gitClient gitClient, path string) (ghrepo.Interface, error) {
768 scopedClient := gitClient.ForRepo(path)

Callers 2

InstallMethod · 0.85
upgradeExtensionMethod · 0.85

Calls 2

fetchLatestReleaseFunction · 0.85
possibleDistsFunction · 0.85

Tested by

no test coverage detected