File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,11 @@ import (
21
21
"encoding/json"
22
22
"fmt"
23
23
"net/url"
24
+ "path/filepath"
24
25
"sort"
25
26
"strings"
26
27
28
+ "github.com/arduino/arduino-cli/arduino/globals"
27
29
"github.com/arduino/arduino-cli/arduino/resources"
28
30
"github.com/arduino/arduino-cli/arduino/utils"
29
31
"github.com/arduino/arduino-cli/i18n"
@@ -360,8 +362,13 @@ func (release *PlatformRelease) String() string {
360
362
361
363
// ToRPCPlatformReference creates a gRPC PlatformReference message out of this PlatformRelease
362
364
func (release * PlatformRelease ) ToRPCPlatformReference () * rpc.InstalledPlatformReference {
365
+ defaultUrlPrefix := globals .DefaultIndexURL
366
+ // TODO: create a IndexURL object to factorize this
367
+ defaultUrlPrefix = strings .TrimSuffix (defaultUrlPrefix , filepath .Ext (defaultUrlPrefix ))
368
+ defaultUrlPrefix = strings .TrimSuffix (defaultUrlPrefix , filepath .Ext (defaultUrlPrefix )) // removes .tar.bz2
369
+
363
370
url := release .Platform .Package .URL
364
- if strings .HasPrefix (url , "https://downloads.arduino.cc/packages/package_index." ) {
371
+ if strings .HasPrefix (url , defaultUrlPrefix ) {
365
372
url = ""
366
373
}
367
374
return & rpc.InstalledPlatformReference {
You can’t perform that action at this time.
0 commit comments