mirror of
https://github.com/CosmicStar98/bedrocktool.git
synced 2024-06-01 22:25:15 +00:00
async update check
This commit is contained in:
parent
191f1ecd9a
commit
b7ad339a64
|
@ -78,14 +78,16 @@ func main() {
|
||||||
logrus.Infof(locale.Loc("bedrocktool_version", locale.Strmap{"Version": utils.Version}))
|
logrus.Infof(locale.Loc("bedrocktool_version", locale.Strmap{"Version": utils.Version}))
|
||||||
}
|
}
|
||||||
|
|
||||||
newVersion, err := utils.Updater.UpdateAvailable()
|
go func() {
|
||||||
if err != nil {
|
newVersion, err := utils.Updater.UpdateAvailable()
|
||||||
logrus.Error(err)
|
if err != nil {
|
||||||
}
|
logrus.Error(err)
|
||||||
|
}
|
||||||
|
|
||||||
if newVersion != "" && utils.Version != "" {
|
if newVersion != "" && utils.Version != "" {
|
||||||
logrus.Infof(locale.Loc("update_available", locale.Strmap{"Version": newVersion}))
|
logrus.Infof(locale.Loc("update_available", locale.Strmap{"Version": newVersion}))
|
||||||
}
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
|
|
||||||
|
@ -125,7 +127,7 @@ func main() {
|
||||||
logrus.Error("Failed to init UI!")
|
logrus.Error("Failed to init UI!")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = ui.Start(ctx, cancel)
|
err := ui.Start(ctx, cancel)
|
||||||
cancel()
|
cancel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Error(err)
|
logrus.Error(err)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user