increment versions

This commit is contained in:
Jeff Carr 2024-03-02 20:47:36 -06:00
parent 412c84fcd9
commit 65a94faa57
1 changed files with 37 additions and 0 deletions

View File

@ -182,6 +182,43 @@ func (rs *RepoStatus) SetVersion(a, b, c string, reason string) {
// rs.versionMessage.SetValue(reason) // rs.versionMessage.SetValue(reason)
} }
func (rs *RepoStatus) IncrementMinorVersion(reason string) {
lasttag := rs.lasttag.String()
var major, minor, revision string
major, minor, revision = splitVersion(lasttag)
olda, _ := strconv.Atoi(major)
oldb, _ := strconv.Atoi(minor)
oldc, _ := strconv.Atoi(revision)
oldb += 1
oldc = 0
newa := strconv.Itoa(olda)
newb := strconv.Itoa(oldb)
newc := strconv.Itoa(oldc)
rs.SetVersion(newa, newb, newc, reason)
}
func (rs *RepoStatus) IncrementRevisionVersion(reason string) {
lasttag := rs.lasttag.String()
var major, minor, revision string
major, minor, revision = splitVersion(lasttag)
olda, _ := strconv.Atoi(major)
oldb, _ := strconv.Atoi(minor)
oldc, _ := strconv.Atoi(revision)
oldc += 1
newa := strconv.Itoa(olda)
newb := strconv.Itoa(oldb)
newc := strconv.Itoa(oldc)
rs.SetVersion(newa, newb, newc, reason)
}
func (rs *RepoStatus) setTag() bool { func (rs *RepoStatus) setTag() bool {
lasttag := rs.lasttag.String() lasttag := rs.lasttag.String()
var major, minor, revision string var major, minor, revision string