1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-03 02:07:06 +00:00

remove old deprecated code from previous version, no need to keep backward compatibility, it was two months ago v10.0.0 released so we should be ok now

Former-commit-id: 81ac9d4913e78154b4bb74a01ce707b510e674ec
This commit is contained in:
Gerasimos (Makis) Maropoulos
2018-02-12 06:03:15 +02:00
parent 7fd8baea75
commit fce7959424
5 changed files with 5 additions and 240 deletions

View File

@@ -19,34 +19,25 @@ const (
// CheckForUpdates checks for any available updates
// and asks for the user if want to update now or not.
func CheckForUpdates(ft bool) {
has := true
if ft {
has, ft = hasInternetConnection()
}
v := version.Acquire()
updateAvailale := v.Compare(Version) == version.Smaller
if updateAvailale {
if confirmUpdate(v) {
canUpdate := (has && ft && ask()) || !has || !ft
if canUpdate {
installVersion()
}
installVersion()
return
}
}
}
func confirmUpdate(v version.Version) bool {
// on help? when asking for installing the new update
// and when answering "No".
// on help? when asking for installing the new update.
ignoreUpdatesMsg := "Would you like to ignore future updates? Disable the version checker via:\napp.Run(..., iris.WithoutVersionChecker)"
// if update available ask for update action.
shouldUpdateNowMsg :=
fmt.Sprintf("A new version is available online[%s < %s].\nRelease notes: %s.\nUpdate now?",
Version, v.String(),
v.ChangelogURL)
fmt.Sprintf("A new version is available online[%s > %s]. Type '?' for help.\nRelease notes: %s.\nUpdate now?",
v.String(), Version, v.ChangelogURL)
var confirmUpdate bool
survey.AskOne(&survey.Confirm{