MCPcopy Create free account
hub / github.com/SummerSec/SpringExploit / doSelfUpdate

Function doSelfUpdate

cmd/commons/core/update2.go:15–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13const info = "SummerSec/SpringExploit"
14
15func 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
39func confirmAndSelfUpdate() {
40 latest, found, err := selfupdate.DetectLatest(info)

Callers 1

RunMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected