File tree 1 file changed +7
-1
lines changed
arduino/cores/packagemanager
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -23,16 +23,22 @@ import (
23
23
"github.com/arduino/arduino-cli/arduino/cores"
24
24
"github.com/arduino/arduino-cli/arduino/cores/packageindex"
25
25
"github.com/arduino/arduino-cli/executils"
26
+ "github.com/arduino/go-paths-helper"
26
27
"github.com/pkg/errors"
27
28
)
28
29
29
- // InstallPlatform installs a specific release of a platform.
30
+ // InstallPlatform installs a specific release of a platform in the default data directory .
30
31
func (pm * PackageManager ) InstallPlatform (platformRelease * cores.PlatformRelease ) error {
31
32
destDir := pm .PackagesDir .Join (
32
33
platformRelease .Platform .Package .Name ,
33
34
"hardware" ,
34
35
platformRelease .Platform .Architecture ,
35
36
platformRelease .Version .String ())
37
+ return pm .InstallPlatformInDirectory (platformRelease , destDir )
38
+ }
39
+
40
+ // InstallPlatformInDirectory installs a specific release of a platform in a specific directory.
41
+ func (pm * PackageManager ) InstallPlatformInDirectory (platformRelease * cores.PlatformRelease , destDir * paths.Path ) error {
36
42
if err := platformRelease .Resource .Install (pm .DownloadDir , pm .TempDir , destDir ); err != nil {
37
43
return errors .Errorf (tr ("installing platform %[1]s: %[2]s" ), platformRelease , err )
38
44
}
You can’t perform that action at this time.
0 commit comments