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

Function isBinExtension

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

Source from the content-addressed store, hash-verified

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