From f402de4c60ff3a0d580d7df6aebf37564991167c Mon Sep 17 00:00:00 2001 From: matryer Date: Sat, 13 Mar 2021 10:50:20 +0000 Subject: [PATCH] added some delays to see if that helps updates complete normally --- app/app.go | 3 +++ pkg/update/update.go | 2 ++ 2 files changed, 5 insertions(+) diff --git a/app/app.go b/app/app.go index 9d19df088..708f48515 100644 --- a/app/app.go +++ b/app/app.go @@ -610,6 +610,9 @@ func (app *app) checkForUpdates(passive bool) { }) return } + // wait for the update to complete before + // restarting. + time.Sleep(1 * time.Second) err = u.Restart() if err != nil { app.runtime.Dialog.Message(&dialog.MessageDialog{ diff --git a/pkg/update/update.go b/pkg/update/update.go index 0a6281435..97f7d0b20 100644 --- a/pkg/update/update.go +++ b/pkg/update/update.go @@ -226,6 +226,8 @@ type Asset struct { BrowserDownloadURL string `json:"browser_download_url"` } +// appPathFromExecutable gets the .app path from the currently +// running executable. func appPathFromExecutable(p string) (string, error) { if !strings.HasSuffix(p, "/Contents/MacOS/xbar") { return "", errors.New("executable not where it should be")