Final pre-launch version: Update logic

This commit is contained in:
Andy Dixon
2026-04-28 09:35:53 +01:00
parent 5699d17fb6
commit c656d2ff44
13 changed files with 392 additions and 21 deletions
+14 -2
View File
@@ -36,6 +36,9 @@ import (
// appVersion is set at build time via ldflags.
var appVersion = "dev"
// appUpdateURL is set at build time via ldflags.
var appUpdateURL = ""
// Service is the main API surface exposed to the frontend via Wails bindings.
type Service struct {
store *storage.Store
@@ -1298,8 +1301,17 @@ func (s *Service) ImportSSHConfig(configPath string, folder string) (int, error)
// CheckForUpdates queries GitHub Releases for a newer version.
func (s *Service) CheckForUpdates() (map[string]interface{}, error) {
checker := updater.NewChecker(appVersion)
info, err := checker.Check(context.Background())
ctx := context.Background()
var info *updater.UpdateInfo
var err error
if appUpdateURL != "" {
checker := updater.NewURLChecker(appUpdateURL, appVersion)
info, err = checker.Check(ctx)
} else {
checker := updater.NewChecker(appVersion)
info, err = checker.Check(ctx)
}
if err != nil {
return nil, err
}