MCPcopy
hub / github.com/cli/cli / URL

Method URL

pkg/cmd/extension/extension.go:59–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57}
58
59func (e *Extension) URL() string {
60 e.mu.RLock()
61 if e.url != "" {
62 defer e.mu.RUnlock()
63 return e.url
64 }
65 e.mu.RUnlock()
66
67 var url string
68 switch e.kind {
69 case LocalKind:
70 case BinaryKind:
71 if manifest, err := e.loadManifest(); err == nil {
72 repo := ghrepo.NewWithHost(manifest.Owner, manifest.Name, manifest.Host)
73 url = ghrepo.GenerateRepoURL(repo, "")
74 }
75 case GitKind:
76 if remoteURL, err := e.gitClient.Config("remote.origin.url"); err == nil {
77 url = strings.TrimSpace(string(remoteURL))
78 }
79 }
80
81 e.mu.Lock()
82 e.url = url
83 e.mu.Unlock()
84
85 return e.url
86}
87
88func (e *Extension) CurrentVersion() string {
89 e.mu.RLock()

Callers 1

LatestVersionMethod · 0.95

Calls 4

loadManifestMethod · 0.95
NewWithHostFunction · 0.92
GenerateRepoURLFunction · 0.92
ConfigMethod · 0.65

Tested by

no test coverage detected