diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-09-03 19:42:06 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-03 19:42:06 +1000 |
commit | dfb87d34dcf0e18d7a6b8ec6436e8fbe53c28ade (patch) | |
tree | 42b4e4949ba454db73ec719452aeabe609c247b9 /pkg | |
parent | 4ab1a1f72be0330242a6a432b4d197fac375d4a9 (diff) | |
parent | b65fa852f187c820901e67f77b1fb8ac8dbd4ea3 (diff) |
Merge branch 'master' into hotfix/238-xdg-open
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/i18n/english.go | 2 | ||||
-rw-r--r-- | pkg/updates/updates.go | 16 |
2 files changed, 13 insertions, 5 deletions
diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index f6e865b7b..1d9e8b41e 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -329,7 +329,7 @@ func addEnglish(i18nObject *i18n.Bundle) error { Other: "You already have the latest version", }, &i18n.Message{ ID: "MajorVersionErr", - Other: "New version has non-backwards compatible changes.", + Other: "New version ({{.newVersion}}) has non-backwards compatible changes compared to the current version ({{.currentVersion}})", }, &i18n.Message{ ID: "CouldNotFindBinaryErr", Other: "Could not find any binary at {{.url}}", diff --git a/pkg/updates/updates.go b/pkg/updates/updates.go index 5f533e5a0..4ec374616 100644 --- a/pkg/updates/updates.go +++ b/pkg/updates/updates.go @@ -96,6 +96,7 @@ func (u *Updater) majorVersionDiffers(oldVersion, newVersion string) bool { func (u *Updater) checkForNewUpdate() (string, error) { u.Log.Info("Checking for an updated version") + currentVersion := u.Config.GetVersion() if err := u.RecordLastUpdateCheck(); err != nil { return "", err } @@ -104,15 +105,22 @@ func (u *Updater) checkForNewUpdate() (string, error) { if err != nil { return "", err } - u.Log.Info("Current version is " + u.Config.GetVersion()) + u.Log.Info("Current version is " + currentVersion) u.Log.Info("New version is " + newVersion) - if newVersion == u.Config.GetVersion() { + if newVersion == currentVersion { return "", errors.New(u.Tr.SLocalize("OnLatestVersionErr")) } - if u.majorVersionDiffers(u.Config.GetVersion(), newVersion) { - return "", errors.New(u.Tr.SLocalize("MajorVersionErr")) + if u.majorVersionDiffers(currentVersion, newVersion) { + errMessage := u.Tr.TemplateLocalize( + "MajorVersionErr", + i18n.Teml{ + "newVersion": newVersion, + "currentVersion": currentVersion, + }, + ) + return "", errors.New(errMessage) } rawUrl, err := u.getBinaryUrl(newVersion) |