Skip to content

Commit 721792b

Browse files
committed
disable auto-update
1 parent 49de0e0 commit 721792b

File tree

1 file changed

+24
-23
lines changed

1 file changed

+24
-23
lines changed

Diff for: update.go

+24-23
Original file line numberDiff line numberDiff line change
@@ -30,38 +30,39 @@
3030
package main
3131

3232
import (
33-
"github.com/arduino/arduino-create-agent/updater"
33+
log "github.com/sirupsen/logrus"
34+
3435
"github.com/gin-gonic/gin"
35-
"github.com/kardianos/osext"
3636
)
3737

3838
func updateHandler(c *gin.Context) {
3939

40-
path, err := osext.Executable()
40+
// path, err := osext.Executable()
4141

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+
// }
4646

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+
// }
5555

56-
err = up.BackgroundRun()
56+
// err = up.BackgroundRun()
5757

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+
// }
6262

63-
path = updater.TempPath(path)
63+
// path = updater.TempPath(path)
6464

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)
6768
}

0 commit comments

Comments
 (0)