checkSemver validates that the version of a tool meets the minimum required version listed in your requirement. Returns a boolean. For more information on parsing semver, see semver.org If your tool doesn't do full semver then you may need to add custom logic to support it.
(req requirement, actualVersion *semver.Version)
| 93 | // If your tool doesn't do full semver then you may need to add custom logic |
| 94 | // to support it. |
| 95 | func checkSemver(req requirement, actualVersion *semver.Version) bool { |
| 96 | requiredVersion := semver.New(req.minVersion) |
| 97 | return actualVersion.LessThan(*requiredVersion) |
| 98 | } |
| 99 | |
| 100 | var checkCmd = &cobra.Command{ |
| 101 | Use: "check", |