@@ -25,8 +25,8 @@ import (
25
25
"strings"
26
26
27
27
"github.com/arduino/arduino-cli/arduino"
28
- "github.com/arduino/arduino-cli/commands"
29
28
"github.com/arduino/arduino-cli/commands/compile"
29
+ "github.com/arduino/arduino-cli/commands/core"
30
30
"github.com/arduino/arduino-cli/commands/sketch"
31
31
"github.com/arduino/arduino-cli/commands/upload"
32
32
"github.com/arduino/arduino-cli/configuration"
@@ -362,13 +362,15 @@ func runCompileCommand(cmd *cobra.Command, args []string) {
362
362
panic (tr ("Platform ID is not correct" ))
363
363
}
364
364
365
- pme , release := commands .GetPackageManagerExplorer (compileRequest )
366
- platform := pme .FindPlatform (split [0 ], split [1 ])
367
- release ()
368
-
369
365
if profileArg .String () == "" {
370
366
res .Error += fmt .Sprintln ()
371
- if platform != nil {
367
+
368
+ if platform , errS := core .PlatformSearch (& rpc.PlatformSearchRequest {
369
+ Instance : inst ,
370
+ SearchArgs : platformErr .Platform ,
371
+ AllVersions : false }); errS != nil {
372
+ res .Error += tr ("%v" , errS )
373
+ } else if len (platform .GetSearchOutput ()) > 0 {
372
374
suggestion := fmt .Sprintf ("`%s core install %s`" , version .VersionInfo .Application , platformErr .Platform )
373
375
res .Error += tr ("Try running %s" , suggestion )
374
376
} else {
0 commit comments