@@ -25,8 +25,8 @@ import (
2525 "strings"
2626
2727 "github.com/arduino/arduino-cli/arduino"
28- "github.com/arduino/arduino-cli/commands"
2928 "github.com/arduino/arduino-cli/commands/compile"
29+ "github.com/arduino/arduino-cli/commands/core"
3030 "github.com/arduino/arduino-cli/commands/sketch"
3131 "github.com/arduino/arduino-cli/commands/upload"
3232 "github.com/arduino/arduino-cli/configuration"
@@ -362,13 +362,15 @@ func runCompileCommand(cmd *cobra.Command, args []string) {
362362 panic (tr ("Platform ID is not correct" ))
363363 }
364364
365- pme , release := commands .GetPackageManagerExplorer (compileRequest )
366- platform := pme .FindPlatform (split [0 ], split [1 ])
367- release ()
368-
369365 if profileArg .String () == "" {
370366 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 {
372374 suggestion := fmt .Sprintf ("`%s core install %s`" , version .VersionInfo .Application , platformErr .Platform )
373375 res .Error += tr ("Try running %s" , suggestion )
374376 } else {
0 commit comments