Corrected version detection, so that equal versions match

This commit is contained in:
notzippy@gmail.com
2020-04-26 09:57:35 -07:00
parent f2b54f5a69
commit c1aee24445
3 changed files with 6 additions and 4 deletions

View File

@@ -21,6 +21,7 @@ type Version struct {
var frameworkCompatibleRangeList = [][]string{
{"0.0.0", "0.20.0"}, // minimum Revel version to use with this version of the tool
{"0.19.99", "0.30.0"}, // Compatible with Framework V 0.19.99 - 0.30.0
{"1.0.0", "1.1.0"}, // Compatible with Framework V 1.0 - 1.1
}
// Parses a version like v1.2.3a or 1.2
@@ -70,6 +71,7 @@ func (v *Version) CompatibleFramework(c *CommandConfig) error {
if !v.Newer(start) || v.Newer(end) {
continue
}
// Framework is older then 0.20, turn on historic mode
if i == 0 {
c.HistoricMode = true
@@ -109,7 +111,7 @@ func (v *Version) Newer(o *Version) bool {
if v.Maintenance != o.Maintenance {
return v.Maintenance > o.Maintenance
}
return false
return true
}
// Convert the version to a string