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

Function isBinExtension

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

Source from the content-addressed store, hash-verified

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