MCPcopy Create free account
hub / github.com/anchordotdev/cli / getLatestRelease

Function getLatestRelease

cli.go:73–89  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

71}
72
73func getLatestRelease(ctx context.Context) (*Release, error) {
74 if LatestRelease != nil {
75 return LatestRelease, nil
76 }
77
78 release, _, err := github.NewClient(nil).Repositories.GetLatestRelease(ctx, "anchordotdev", "cli")
79 if err != nil {
80 return nil, err
81 }
82
83 LatestRelease = &Release{
84 PublishedAt: release.PublishedAt,
85 TagName: release.TagName,
86 }
87
88 return LatestRelease, nil
89}
90
91func UserAgent() string {
92 return "Anchor CLI " + VersionString()

Callers 2

IsFreshLatestReleaseFunction · 0.85
IsUpgradeableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected