MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / CompareVersions

Function CompareVersions

internal/update/update.go:206–210  ·  view source on GitHub ↗

CompareVersions returns true if latest is different from the base version of current. Dev builds (e.g. "0.4.0-61-gd06835b") are compared by their base tag ("0.4.0").

(current, latest string)

Source from the content-addressed store, hash-verified

204// CompareVersions returns true if latest is different from the base version of current.
205// Dev builds (e.g. "0.4.0-61-gd06835b") are compared by their base tag ("0.4.0").
206func CompareVersions(current, latest string) bool {
207 current = normalizeVersion(current)
208 latest = normalizeVersion(latest)
209 return baseVersion(current) != latest && current != "dev"
210}
211
212// findAssets locates the binary and checksum assets for the given OS/arch.
213func findAssets(assets []Asset, goos, goarch string) (*Asset, *Asset) {

Callers 1

TestCompareVersionsFunction · 0.85

Calls 2

normalizeVersionFunction · 0.85
baseVersionFunction · 0.85

Tested by 1

TestCompareVersionsFunction · 0.68