Skip to content

Commit 3616d45

Browse files
committed
Manually installed platforms are now shown in core search output
This also updates the json output and the gRPC interface
1 parent 079bb6c commit 3616d45

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

commands/core/search.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func PlatformSearch(instanceID int32, searchArgs string, allVersions bool) (*rpc
4848
for _, targetPackage := range pm.Packages {
4949
for _, platform := range targetPackage.Platforms {
5050
// discard invalid platforms
51-
if platform == nil || platform.Name == "" {
51+
if platform == nil {
5252
continue
5353
}
5454

test/test_core.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import simplejson as json
1919
import tempfile
2020
import hashlib
21+
from git import Repo
2122
from pathlib import Path
2223

2324

@@ -363,3 +364,24 @@ def test_core_update_with_local_url(run_command):
363364
res = run_command(f'core update-index --additional-urls="file://{test_index}"')
364365
assert res.ok
365366
assert "Updating index: test_index.json downloaded" in res.stdout
367+
368+
369+
def test_core_search_list_manually_installed_cores(run_command, data_dir):
370+
assert run_command("core update-index")
371+
372+
# Verifies only cores in
373+
res = run_command("core search --format json")
374+
assert res.ok
375+
cores = json.loads(res.stdout)
376+
assert len(cores) == 17
377+
378+
# Manually installs a core in sketchbooks hardware folder
379+
git_url = "https://github.com/arduino/ArduinoCore-avr.git"
380+
repo_dir = Path(data_dir, "hardware", "arduino-beta-development", "avr")
381+
assert Repo.clone_from(git_url, repo_dir)
382+
383+
# Verifies manually installed core is correctly found
384+
res = run_command("core search --format json")
385+
assert res.ok
386+
cores = json.loads(res.stdout)
387+
assert len(cores) == 18

0 commit comments

Comments
 (0)