parse legacy version too
This commit is contained in:
@@ -216,9 +216,9 @@ func FrontendConfigFromStruct(cfg *config.Config) map[string]interface{} {
|
|||||||
"version": map[string]interface{}{
|
"version": map[string]interface{}{
|
||||||
"product": "Infinite Scale",
|
"product": "Infinite Scale",
|
||||||
"edition": "Community",
|
"edition": "Community",
|
||||||
"major": version.Parsed().Major(),
|
"major": version.ParsedLegacy().Major(),
|
||||||
"minor": version.Parsed().Minor(),
|
"minor": version.ParsedLegacy().Minor(),
|
||||||
"micro": version.Parsed().Patch(),
|
"micro": version.ParsedLegacy().Patch(),
|
||||||
"string": version.LegacyString,
|
"string": version.LegacyString,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package version
|
package version
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strconv"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Masterminds/semver"
|
"github.com/Masterminds/semver"
|
||||||
@@ -50,9 +49,11 @@ func Parsed() *semver.Version {
|
|||||||
return parsedVersion
|
return parsedVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
// Long returns the legacy version with 4 number parts like 10.9.8.0
|
// ParsedLegacy returns the legacy version
|
||||||
func Long() string {
|
func ParsedLegacy() *semver.Version {
|
||||||
return strconv.FormatInt(Parsed().Major(), 10) + "." +
|
parsedVersion, err := semver.NewVersion(LegacyString)
|
||||||
strconv.FormatInt(Parsed().Minor(), 10) + "." +
|
if err != nil {
|
||||||
strconv.FormatInt(Parsed().Patch(), 10) + "." + "0"
|
return &semver.Version{}
|
||||||
|
}
|
||||||
|
return parsedVersion
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user