File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
arduino/cores/packagemanager Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -439,6 +439,21 @@ func (pm *PackageManager) InstalledBoards() []*cores.Board {
439439 return boards
440440}
441441
442+ // GetTool search for tool in all packages and platforms.
443+ func (pm * PackageManager ) GetTool (toolId string ) * cores.Tool {
444+ split := strings .Split (toolId , ":" )
445+ if len (split ) != 2 {
446+ return nil
447+ }
448+ if pack , ok := pm .Packages [split [0 ]]; ! ok {
449+ return nil
450+ } else if tool , ok := pack .Tools [split [1 ]]; ! ok {
451+ return nil
452+ } else {
453+ return tool
454+ }
455+ }
456+
442457func (pm * PackageManager ) FindToolsRequiredFromPlatformRelease (platform * cores.PlatformRelease ) ([]* cores.ToolRelease , error ) {
443458 pm .Log .Infof ("Searching tools required for platform %s" , platform )
444459
You can’t perform that action at this time.
0 commit comments