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

Function isBinExtension

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

Source from the content-addressed store, hash-verified

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