@@ -36,7 +36,6 @@ import (
36
36
"github.com/arduino/arduino-cli/internal/arduino/resources"
37
37
"github.com/arduino/arduino-cli/internal/arduino/sketch"
38
38
"github.com/arduino/arduino-cli/internal/arduino/utils"
39
- "github.com/arduino/arduino-cli/internal/cli/configuration"
40
39
"github.com/arduino/arduino-cli/internal/i18n"
41
40
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
42
41
paths "github.com/arduino/go-paths-helper"
@@ -72,7 +71,7 @@ func (s *arduinoCoreServerImpl) Create(ctx context.Context, req *rpc.CreateReque
72
71
}
73
72
74
73
// Setup downloads directory
75
- downloadsDir := configuration . DownloadsDir ( s .settings )
74
+ downloadsDir := s .settings . DownloadsDir ( )
76
75
if downloadsDir .NotExist () {
77
76
err := downloadsDir .MkdirAll ()
78
77
if err != nil {
@@ -81,8 +80,8 @@ func (s *arduinoCoreServerImpl) Create(ctx context.Context, req *rpc.CreateReque
81
80
}
82
81
83
82
// Setup data directory
84
- dataDir := configuration . DataDir ( s .settings )
85
- packagesDir := configuration . PackagesDir ( s .settings )
83
+ dataDir := s .settings . DataDir ( )
84
+ packagesDir := s .settings . PackagesDir ( )
86
85
if packagesDir .NotExist () {
87
86
err := packagesDir .MkdirAll ()
88
87
if err != nil {
@@ -192,7 +191,7 @@ func (s *arduinoCoreServerImpl) Init(req *rpc.InitRequest, stream rpc.ArduinoCor
192
191
}
193
192
}
194
193
195
- if err := firstUpdate (ctx , s , req .GetInstance (), configuration . DataDir ( s .settings ), downloadCallback , allPackageIndexUrls ); err != nil {
194
+ if err := firstUpdate (ctx , s , req .GetInstance (), s .settings . DataDir ( ), downloadCallback , allPackageIndexUrls ); err != nil {
196
195
e := & cmderrors.InitFailedError {
197
196
Code : codes .InvalidArgument ,
198
197
Cause : err ,
@@ -245,7 +244,7 @@ func (s *arduinoCoreServerImpl) Init(req *rpc.InitRequest, stream rpc.ArduinoCor
245
244
246
245
// Load Platforms
247
246
if profile == nil {
248
- for _ , err := range pmb .LoadHardware (s . settings ) {
247
+ for _ , err := range pmb .LoadHardware () {
249
248
s := & cmderrors.PlatformLoadingError {Cause : err }
250
249
responseError (s .GRPCStatus ())
251
250
}
@@ -349,7 +348,7 @@ func (s *arduinoCoreServerImpl) Init(req *rpc.InitRequest, stream rpc.ArduinoCor
349
348
350
349
if profile == nil {
351
350
// Add directories of libraries bundled with IDE
352
- if bundledLibsDir := configuration . IDEBuiltinLibrariesDir ( s .settings ); bundledLibsDir != nil {
351
+ if bundledLibsDir := s .settings . IDEBuiltinLibrariesDir ( ); bundledLibsDir != nil {
353
352
lmb .AddLibrariesDir (librariesmanager.LibrariesDir {
354
353
Path : bundledLibsDir ,
355
354
Location : libraries .IDEBuiltIn ,
@@ -358,14 +357,14 @@ func (s *arduinoCoreServerImpl) Init(req *rpc.InitRequest, stream rpc.ArduinoCor
358
357
359
358
// Add libraries directory from config file
360
359
lmb .AddLibrariesDir (librariesmanager.LibrariesDir {
361
- Path : configuration . LibrariesDir ( s .settings ),
360
+ Path : s .settings . LibrariesDir ( ),
362
361
Location : libraries .User ,
363
362
})
364
363
} else {
365
364
// Load libraries required for profile
366
365
for _ , libraryRef := range profile .Libraries {
367
366
uid := libraryRef .InternalUniqueIdentifier ()
368
- libRoot := configuration . ProfilesCacheDir ( s .settings ).Join (uid )
367
+ libRoot := s .settings . ProfilesCacheDir ( ).Join (uid )
369
368
libDir := libRoot .Join (libraryRef .Library )
370
369
371
370
if ! libDir .IsDir () {
@@ -548,7 +547,7 @@ func (s *arduinoCoreServerImpl) UpdateIndex(req *rpc.UpdateIndexRequest, stream
548
547
Message : & rpc.UpdateIndexResponse_DownloadProgress {DownloadProgress : p },
549
548
})
550
549
}
551
- indexpath := configuration . DataDir ( s .settings )
550
+ indexpath := s .settings . DataDir ( )
552
551
553
552
urls := []string {globals .DefaultIndexURL }
554
553
if ! req .GetIgnoreCustomPackageIndexes () {
@@ -614,6 +613,7 @@ func (s *arduinoCoreServerImpl) UpdateIndex(req *rpc.UpdateIndexRequest, stream
614
613
downloadCB .Start (u , tr ("Downloading index: %s" , filepath .Base (URL .Path )))
615
614
downloadCB .End (false , tr ("Invalid network configuration: %s" , err ))
616
615
failed = true
616
+ continue
617
617
}
618
618
619
619
if strings .HasSuffix (URL .Host , "arduino.cc" ) && strings .HasSuffix (URL .Path , ".json" ) {
0 commit comments