feat: better version handling for update check

This commit is contained in:
Toby 2022-11-03 19:50:42 +00:00
parent a7675b2f5b
commit 508ff69ea9

View File

@ -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,