MCPcopy Create free account
hub / github.com/cronitorio/cronitor-cli / isNewer

Function isNewer

cmd/update.go:278–299  ·  view source on GitHub ↗
(latest, current string)

Source from the content-addressed store, hash-verified

276}
277
278func isNewer(latest, current string) bool {
279 // Split versions into parts
280 latestParts := strings.Split(latest, ".")
281 currentParts := strings.Split(current, ".")
282
283 // Convert to integers for comparison
284 latestMajor, _ := strconv.Atoi(latestParts[0])
285 latestMinor, _ := strconv.Atoi(latestParts[1])
286 currentMajor, _ := strconv.Atoi(currentParts[0])
287 currentMinor, _ := strconv.Atoi(currentParts[1])
288
289 // Compare major version first
290 if latestMajor > currentMajor {
291 return true
292 }
293 if latestMajor < currentMajor {
294 return false
295 }
296
297 // If major versions are equal, compare minor versions
298 return latestMinor > currentMinor
299}

Callers 1

checkForUpdateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected