VersionsMatch compares the two versions. It assumes the versions match if the major and the minor versions are equivalent. Patch versions are disregarded. If it detects that either version is a developer build it returns true.
(v1, v2 string)
| 74 | // disregarded. If it detects that either version is a developer build it |
| 75 | // returns true. |
| 76 | func VersionsMatch(v1, v2 string) bool { |
| 77 | // If no version is attached, then it is a dev build outside of CI. The version |
| 78 | // will be disregarded... hopefully they know what they are doing. |
| 79 | if strings.Contains(v1, noVersion) || strings.Contains(v2, noVersion) { |
| 80 | return true |
| 81 | } |
| 82 | |
| 83 | return semver.MajorMinor(v1) == semver.MajorMinor(v2) |
| 84 | } |
| 85 | |
| 86 | func IsDevVersion(v string) bool { |
| 87 | return strings.Contains(v, "-"+develPreRelease) |