| 13 | const info = "SummerSec/SpringExploit" |
| 14 | |
| 15 | func doSelfUpdate() { |
| 16 | latest, found, err := selfupdate.DetectLatest(info) |
| 17 | if err != nil { |
| 18 | log.Infoln("Error occurred while detecting version:", err) |
| 19 | return |
| 20 | } |
| 21 | |
| 22 | v := semver.MustParse(version) |
| 23 | if !found || latest.Version.LTE(v) { |
| 24 | log.Infof("Current binary is the latest version %s", version) |
| 25 | return |
| 26 | } |
| 27 | |
| 28 | latest1, err := selfupdate.UpdateSelf(v, info) |
| 29 | |
| 30 | if latest1.Version.LTE(v) { |
| 31 | log.Infof("Current binary is the latest version %s", version) |
| 32 | |
| 33 | } else { |
| 34 | log.Infoln("Successfully updated to version", latest.Version) |
| 35 | log.Infoln("Release note:\n", latest.ReleaseNotes) |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | func confirmAndSelfUpdate() { |
| 40 | latest, found, err := selfupdate.DetectLatest(info) |