Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
92c1ce74e5 | |||
8e5a94e8d8 |
10
version.go
10
version.go
@@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
version = "1.1.1"
|
||||
version = "1.1.2"
|
||||
versionUrl = "https://git.burkey.co/eburk/epochcli/raw/branch/master/version.go"
|
||||
)
|
||||
|
||||
@@ -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