mirror of
https://github.com/cmz0228/hysteria-dev.git
synced 2025-06-09 05:49:54 +00:00
feat: better version handling for update check
This commit is contained in:
parent
a7675b2f5b
commit
508ff69ea9
@ -4,6 +4,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
@ -19,8 +20,9 @@ type releaseInfo struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func checkUpdate() {
|
func checkUpdate() {
|
||||||
|
sv := strings.Split(appVersion, "-")[0]
|
||||||
info, err := fetchLatestRelease()
|
info, err := fetchLatestRelease()
|
||||||
if err == nil && info.TagName != appVersion {
|
if err == nil && info.TagName != sv {
|
||||||
logrus.WithFields(logrus.Fields{
|
logrus.WithFields(logrus.Fields{
|
||||||
"version": info.TagName,
|
"version": info.TagName,
|
||||||
"url": info.URL,
|
"url": info.URL,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user