@@ -45,6 +45,7 @@ import (
4545 "fmt"
4646 "io"
4747 "os"
48+ "runtime"
4849
4950 "github.com/arduino/go-paths-helper"
5051 "github.com/codeclysm/extract/v3"
@@ -70,7 +71,13 @@ func checkForUpdates(currentVersion string, updateURL string, cmdName string) (s
7071 }
7172
7273 // 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 )
7481 if err != nil {
7582 return "" , err
7683 }
@@ -88,7 +95,13 @@ func checkForUpdates(currentVersion string, updateURL string, cmdName string) (s
8895 defer tmp .RemoveAll ()
8996
9097 // 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"
92105 logrus .WithField ("url" , downloadURL ).Info ("Downloading update" )
93106 download , err := fetch (downloadURL )
94107 if err != nil {
0 commit comments