8000 Increase priority of manually-installed platform. by cmaglie · Pull Request #2810 · arduino/arduino-cli · GitHub
[go: up one dir, main page]

Skip to content

Increase priority of manually-installed platform. #2810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Fixed unit test
  • Loading branch information
cmaglie committed Feb 4, 2025
commit 39383d4a19c75a0517d48a2516babce905d51a2d
2 changes: 1 addition & 1 deletion commands/service_debug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestGetCommandLine(t *testing.T) {
sketchPath := paths.New("testdata", "debug", sketch)
require.NoError(t, sketchPath.ToAbs())

pmb := packagemanager.NewBuilder(nil, nil, nil, nil, nil, "test", downloader.GetDefaultConfig())
pmb := packagemanager.NewBuilder(nil, nil, customHardware, nil, nil, "test", downloader.GetDefaultConfig())
pmb.LoadHardwareFromDirectory(customHardware)
pmb.LoadHardwareFromDirectory(dataDir)

Expand Down
8 changes: 6 additions & 2 deletions internal/arduino/cores/packagemanager/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,12 @@ func (pm *Builder) LoadHardwareFromDirectory(path *paths.Path) []error {
// If the hardware directory is inside, or equals, the sketchbook/hardware directory
// it's not a managed package, otherwise it is.
managed := true
if userInstalled, err := path.IsInsideDir(pm.userPackagesDir.Parent()); err == nil && userInstalled {
managed = false
if pm.userPackagesDir != nil {
if path.EquivalentTo(pm.userPackagesDir) {
managed = false
} else if userInstalled, err := path.IsInsideDir(pm.userPackagesDir); err == nil && userInstalled {
managed = false
}
}

// Scan subdirs
Expand Down
0