Skip to content

Commit 4f8244a

Browse files
committed
Added auto-install procedures for profiles
1 parent 1b53f59 commit 4f8244a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

arduino/cores/packagemanager/profiles.go

+8
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ func (pm *PackageManager) LoadHardwareForProfile(p *sketch.Profile, installMissi
5050

5151
// Load tools dependencies for the platforms
5252
for _, platformRelease := range platformReleases {
53+
// TODO: pm.FindPlatformReleaseDependencies(platformRelease)
54+
5355
for _, toolDep := range platformRelease.ToolDependencies {
5456
indexURL := indexURLs[toolDep.ToolPackager]
5557
if err := pm.loadProfileTool(toolDep, indexURL, installMissing, downloadCB, taskCB); err != nil {
@@ -71,6 +73,12 @@ func (pm *PackageManager) loadProfilePlatform(platformRef *sketch.ProfilePlatfor
7173

7274
uid := platformRef.InternalUniqueIdentifier()
7375
destDir := configuration.ProfilesCacheDir(configuration.Settings).Join(uid)
76+
if !destDir.IsDir() && installMissing {
77+
// Try installing the missing platform
78+
if err := pm.installMissingProfilePlatform(platformRef, destDir, downloadCB, taskCB); err != nil {
79+
return nil, err
80+
}
81+
}
7482
return release, pm.loadPlatformRelease(release, destDir)
7583
}
7684

0 commit comments

Comments
 (0)