From 2006d90d17d415dd3a90d5459f6888598b620636 Mon Sep 17 00:00:00 2001 From: Medzik <87065584+MedzikUser@users.noreply.github.com> Date: Sun, 22 Aug 2021 12:16:39 +0200 Subject: [PATCH] update --- .gitignore | 1 - updater/autoupdate.go | 4 ++-- updater/client.go | 2 +- updater/update.go | 3 +++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 2f688ed..fb1449d 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ # Binaries *.exe -*.exe~ *.out *.test /dist/ diff --git a/updater/autoupdate.go b/updater/autoupdate.go index 57598e6..6bc6420 100644 --- a/updater/autoupdate.go +++ b/updater/autoupdate.go @@ -14,7 +14,7 @@ import ( func (c *Client) AutoUpdater() { // Check on start err := c.Update() - common.CheckErr(err, "AutoUpdater") + common.CheckErr(err, "Auto Updater") ticker := time.NewTicker(c.CheckEvery) @@ -24,7 +24,7 @@ func (c *Client) AutoUpdater() { select { case <-ticker.C: err := c.Update() - common.CheckErr(err, "AutoUpdater") + common.CheckErr(err, "Auto Updater") case <-quit: ticker.Stop() diff --git a/updater/client.go b/updater/client.go index c51d9ed..ebe0799 100644 --- a/updater/client.go +++ b/updater/client.go @@ -23,6 +23,6 @@ type Client struct { // Update Rules - // X.y.z + // Should I update the major? (X.y.z) Major bool } diff --git a/updater/update.go b/updater/update.go index 4173c8d..b0f847b 100644 --- a/updater/update.go +++ b/updater/update.go @@ -17,6 +17,9 @@ func (c *Client) Update() error { updater, err := selfupdate.NewUpdater(selfupdate.Config{ APIToken: c.GitHubToken, }) + if err != nil { + return err + } release, found, err := updater.DetectLatest(c.GitHub) if err != nil {