Skip to content

Commit b05b7e0

Browse files
Replace Download with DowloadFromURL
1 parent c5df87a commit b05b7e0

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

hub.go

+14-2
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,13 @@ func checkCmd(m []byte) {
181181
} else if strings.HasPrefix(sl, "downloadtool") {
182182
go func() {
183183
args := strings.Split(s, " ")
184-
var tool, toolVersion, pack, behaviour string
184+
var tool, toolVersion, pack, behaviour, url, signature, checksum string
185185
toolVersion = "latest"
186186
pack = "arduino"
187187
behaviour = "keep"
188+
url = ""
189+
signature = ""
190+
checksum = ""
188191
if len(args) <= 1 {
189192
mapD := map[string]string{"DownloadStatus": "Error", "Msg": "Not enough arguments"}
190193
mapB, _ := json.Marshal(mapD)
@@ -207,8 +210,17 @@ func checkCmd(m []byte) {
207210
if len(args) > 4 {
208211
behaviour = args[4]
209212
}
213+
if len(args) > 5 {
214+
url = args[5]
215+
}
216+
if len(args) > 6 {
217+
signature = args[6]
218+
}
219+
if len(args) > 7 {
220+
checksum = args[7]
221+
}
210222

211-
err := Tools.Download(pack, tool, toolVersion, behaviour)
223+
err := Tools.DownloadFromURL(pack, tool, toolVersion, behaviour, url, signature, checksum)
212224
if err != nil {
213225
mapD := map[string]string{"DownloadStatus": "Error", "Msg": err.Error()}
214226
mapB, _ := json.Marshal(mapD)

0 commit comments

Comments
 (0)