@@ -19,7 +19,6 @@ import (
19
19
"context"
20
20
"errors"
21
21
"fmt"
22
- "net/http"
23
22
24
23
"github.com/arduino/arduino-cli/arduino/cores"
25
24
"github.com/arduino/arduino-cli/arduino/cores/packagemanager"
@@ -28,8 +27,7 @@ import (
28
27
)
29
28
30
29
// PlatformDownload FIXMEDOC
31
- func PlatformDownload (ctx context.Context , req * rpc.PlatformDownloadReq , downloadCB commands.DownloadProgressCB ,
32
- downloaderHeaders http.Header ) (* rpc.PlatformDownloadResp , error ) {
30
+ func PlatformDownload (ctx context.Context , req * rpc.PlatformDownloadReq , downloadCB commands.DownloadProgressCB ) (* rpc.PlatformDownloadResp , error ) {
33
31
pm := commands .GetPackageManager (req .GetInstance ().GetId ())
34
32
if pm == nil {
35
33
return nil , errors .New ("invalid instance" )
@@ -49,13 +47,13 @@ func PlatformDownload(ctx context.Context, req *rpc.PlatformDownloadReq, downloa
49
47
return nil , fmt .Errorf ("find platform dependencies: %s" , err )
50
48
}
51
49
52
- err = downloadPlatform (pm , platform , downloadCB , downloaderHeaders )
50
+ err = downloadPlatform (pm , platform , downloadCB )
53
51
if err != nil {
54
52
return nil , err
55
53
}
56
54
57
55
for _ , tool := range tools {
58
- err := downloadTool (pm , tool , downloadCB , downloaderHeaders )
56
+ err := downloadTool (pm , tool , downloadCB )
59
57
if err != nil {
60
58
return nil , fmt .Errorf ("downloading tool %s: %s" , tool , err )
61
59
}
@@ -64,22 +62,20 @@ func PlatformDownload(ctx context.Context, req *rpc.PlatformDownloadReq, downloa
64
62
return & rpc.PlatformDownloadResp {}, nil
65
63
}
66
64
67
- func downloadPlatform (pm * packagemanager.PackageManager , platformRelease * cores.PlatformRelease ,
68
- downloadCB commands.DownloadProgressCB , downloaderHeaders http.Header ) error {
65
+ func downloadPlatform (pm * packagemanager.PackageManager , platformRelease * cores.PlatformRelease , downloadCB commands.DownloadProgressCB ) error {
69
66
// Download platform
70
- resp , err := pm .DownloadPlatformRelease (platformRelease , downloaderHeaders )
67
+ resp , err := pm .DownloadPlatformRelease (platformRelease )
71
68
if err != nil {
72
69
return err
73
70
}
74
71
return commands .Download (resp , platformRelease .String (), downloadCB )
75
72
}
76
73
77
- func downloadTool (pm * packagemanager.PackageManager , tool * cores.ToolRelease , downloadCB commands.DownloadProgressCB ,
78
- downloaderHeaders http.Header ) error {
74
+ func downloadTool (pm * packagemanager.PackageManager , tool * cores.ToolRelease , downloadCB commands.DownloadProgressCB ) error {
79
75
// Check if tool has a flavor available for the current OS
80
76
if tool .GetCompatibleFlavour () == nil {
81
77
return fmt .Errorf ("tool %s not available for the current OS" , tool )
82
78
}
83
79
84
- return commands .DownloadToolRelease (pm , tool , downloadCB , downloaderHeaders )
80
+ return commands .DownloadToolRelease (pm , tool , downloadCB )
85
81
}
0 commit comments