actually fix version updates
This commit is contained in:
@@ -30,7 +30,6 @@ func needUpdate() (bool, error) {
|
||||
return false, fmt.Errorf("unable to read response body: %v", err)
|
||||
}
|
||||
|
||||
fmt.Println(string(b))
|
||||
re := regexp.MustCompile(`version\s+=\s+"(\d+.\d+.\d+)"`)
|
||||
ver := re.FindStringSubmatch(string(b))
|
||||
if ver[1] == "" {
|
||||
@@ -47,5 +46,10 @@ func needUpdate() (bool, error) {
|
||||
return false, fmt.Errorf("unable to parse new version to semver: %v", err)
|
||||
}
|
||||
|
||||
return curVer != newVer, nil
|
||||
if curVer.LessThan(newVer) {
|
||||
fmt.Println("Current Version: ", curVer)
|
||||
fmt.Println("Latest Version: ", newVer)
|
||||
return true, nil
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user