|
30 | 30 | package main |
31 | 31 |
|
32 | 32 | import ( |
33 | | - "github.com/arduino/arduino-create-agent/updater" |
| 33 | + log "github.com/sirupsen/logrus" |
| 34 | + |
34 | 35 | "github.com/gin-gonic/gin" |
35 | | - "github.com/kardianos/osext" |
36 | 36 | ) |
37 | 37 |
|
38 | 38 | func updateHandler(c *gin.Context) { |
39 | 39 |
|
40 | | - path, err := osext.Executable() |
| 40 | + // path, err := osext.Executable() |
41 | 41 |
|
42 | | - if err != nil { |
43 | | - c.JSON(500, gin.H{"error": err.Error()}) |
44 | | - return |
45 | | - } |
| 42 | + // if err != nil { |
| 43 | + // c.JSON(500, gin.H{"error": err.Error()}) |
| 44 | + // return |
| 45 | + // } |
46 | 46 |
|
47 | | - var up = &updater.Updater{ |
48 | | - CurrentVersion: version, |
49 | | - APIURL: *updateUrl, |
50 | | - BinURL: *updateUrl, |
51 | | - DiffURL: "", |
52 | | - Dir: "update/", |
53 | | - CmdName: *appName, |
54 | | - } |
| 47 | + // var up = &updater.Updater{ |
| 48 | + // CurrentVersion: version, |
| 49 | + // APIURL: *updateUrl, |
| 50 | + // BinURL: *updateUrl, |
| 51 | + // DiffURL: "", |
| 52 | + // Dir: "update/", |
| 53 | + // CmdName: *appName, |
| 54 | + // } |
55 | 55 |
|
56 | | - err = up.BackgroundRun() |
| 56 | + // err = up.BackgroundRun() |
57 | 57 |
|
58 | | - if err != nil { |
59 | | - c.JSON(500, gin.H{"error": err.Error()}) |
60 | | - return |
61 | | - } |
| 58 | + // if err != nil { |
| 59 | + // c.JSON(500, gin.H{"error": err.Error()}) |
| 60 | + // return |
| 61 | + // } |
62 | 62 |
|
63 | | - path = updater.TempPath(path) |
| 63 | + // path = updater.TempPath(path) |
64 | 64 |
|
65 | | - c.JSON(200, gin.H{"success": "Please wait a moment while the agent reboots itself"}) |
66 | | - Systray.Update(path) |
| 65 | + c.JSON(200, gin.H{"success": "This version of the agent do not support autoupdate, please manually update to a newer one: https://github.com/arduino/arduino-create-agent/releases"}) |
| 66 | + log.Warn("This version of the agent do not support autoupdate, please manually update to a newer one: https://github.com/arduino/arduino-create-agent/releases") |
| 67 | + // Systray.Update(path) |
67 | 68 | } |
0 commit comments