@@ -45,6 +45,7 @@ import (
45
45
"fmt"
46
46
"io"
47
47
"os"
48
+ "runtime"
48
49
49
50
"github.com/arduino/go-paths-helper"
50
51
"github.com/codeclysm/extract/v3"
@@ -70,7 +71,13 @@ func checkForUpdates(currentVersion string, updateURL string, cmdName string) (s
70
71
}
71
72
72
73
// Fetch information about updates
73
- info , err := fetchInfo (updateURL , cmdName )
74
+
75
+ // updateURL: "https://downloads.arduino.cc/"
76
+ // cmdName: "CreateAgent/Stable"
77
+ // plat: "darwin-amd64"
78
+ // info URL: "https://downloads.arduino.cc/CreateAgent/Stable/darwin-amd64-bundle.json"
79
+ infoURL := updateURL + cmdName + "/" + plat + "-bundle.json"
80
+ info , err := fetchInfo (infoURL )
74
81
if err != nil {
75
82
return "" , err
76
83
}
@@ -88,7 +95,13 @@ func checkForUpdates(currentVersion string, updateURL string, cmdName string) (s
88
95
defer tmp .RemoveAll ()
89
96
90
97
// Download the update.
91
- downloadURL := updateURL + cmdName + "/" + info .Version + "/ArduinoCreateAgent.app_notarized.zip"
98
+
99
+ // updateURL: "https://downloads.arduino.cc/"
100
+ // cmdName == "CreateAgent/Stable"
101
+ // info.Version == "1.2.8"
102
+ // runtime.GOARCH: "amd64"
103
+ // downloadURL: "https://downloads.arduino.cc/CreateAgent/Stable/1.2.8/ArduinoCreateAgent.app_arm64_notarized.zip"
104
+ downloadURL := updateURL + cmdName + "/" + info .Version + "/ArduinoCreateAgent.app_" + runtime .GOARCH + "_notarized.zip"
92
105
logrus .WithField ("url" , downloadURL ).Info ("Downloading update" )
93
106
download , err := fetch (downloadURL )
94
107
if err != nil {
0 commit comments