Skip to content

Commit b6e7206

Browse files
fix regression which skipped mannually instaled core in core list
1 parent 2069892 commit b6e7206

File tree

4 files changed

+38
-19
lines changed

4 files changed

+38
-19
lines changed

commands/core/search.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ func PlatformSearch(req *rpc.PlatformSearchRequest) (*rpc.PlatformSearchResponse
4343
searchArgs := utils.SearchTermsFromQueryString(req.SearchArgs)
4444
for _, targetPackage := range pme.GetPackages() {
4545
for _, platform := range targetPackage.Platforms {
46+
if platform == nil {
47+
continue
48+
}
4649
// Users can install platforms manually in the Sketchbook hardware folder,
47-
// the core search command must operate only on platforms installed through
48-
// the PlatformManager, thus we skip the manually installed ones.
49-
if platform == nil || platform.ManuallyInstalled {
50+
// if not explictily requested we skip them.
51+
if !req.ManuallyInstalled && platform.ManuallyInstalled {
5052
continue
5153
}
5254

internal/cli/core/list.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ func List(inst *rpc.Instance, all bool, updatableOnly bool) {
6262
// GetList returns a list of installed platforms.
6363
func GetList(inst *rpc.Instance, all bool, updatableOnly bool) []*rpc.PlatformSummary {
6464
platforms, err := core.PlatformSearch(&rpc.PlatformSearchRequest{
65-
Instance: inst,
66-
AllVersions: true,
65+
Instance: inst,
66+
AllVersions: true,
67+
ManuallyInstalled: true,
6768
})
6869
if err != nil {
6970
feedback.Fatal(tr("Error listing platforms: %v", err), feedback.ErrGeneric)

rpc/cc/arduino/cli/commands/v1/core.pb.go

Lines changed: 27 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rpc/cc/arduino/cli/commands/v1/core.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ message PlatformSearchRequest {
118118
// Whether to show all available versions. `false` causes only the newest
119119
// versions of the cores to be listed in the search results.
120120
bool all_versions = 3;
121+
// Whether to show manually installed platforms. `false` causes to skip
122+
// manually installed platforms.
123+
bool manually_installed = 4;
121124
}
122125

123126
message PlatformSearchResponse {

0 commit comments

Comments
 (0)