Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
c5812eea
Unverified
Commit
c5812eea
authored
Aug 13, 2024
by
Alessio Perugini
Committed by
GitHub
Aug 13, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: list return empty array instead of null, when no cores are installed (#2691)
parent
a0d912da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
internal/cli/core/list.go
internal/cli/core/list.go
+3
-3
internal/integrationtest/core/core_test.go
internal/integrationtest/core/core_test.go
+1
-0
No files found.
internal/cli/core/list.go
View file @
c5812eea
...
...
@@ -88,9 +88,9 @@ func GetList(ctx context.Context, srv rpc.ArduinoCoreServiceServer, inst *rpc.In
}
func
newCoreListResult
(
in
[]
*
rpc
.
PlatformSummary
,
updatableOnly
bool
)
*
coreListResult
{
res
:=
&
coreListResult
{
updatableOnly
:
updatableOnly
}
for
_
,
platformSummary
:=
range
in
{
res
.
Platforms
=
append
(
res
.
Platforms
,
result
.
NewPlatformSummary
(
platformSummary
)
)
res
:=
&
coreListResult
{
updatableOnly
:
updatableOnly
,
Platforms
:
make
([]
*
result
.
PlatformSummary
,
len
(
in
))
}
for
i
,
platformSummary
:=
range
in
{
res
.
Platforms
[
i
]
=
result
.
NewPlatformSummary
(
platformSummary
)
}
return
res
}
...
...
internal/integrationtest/core/core_test.go
View file @
c5812eea
...
...
@@ -1174,6 +1174,7 @@ func TestCoreListWhenNoPlatformAreInstalled(t *testing.T) {
stdout
,
_
,
err
:=
cli
.
Run
(
"core"
,
"list"
,
"--json"
)
require
.
NoError
(
t
,
err
)
requirejson
.
Query
(
t
,
stdout
,
`.platforms | length`
,
`0`
)
requirejson
.
Query
(
t
,
stdout
,
`.platforms | select(.!=null)`
,
`[]`
)
stdout
,
_
,
err
=
cli
.
Run
(
"core"
,
"list"
)
require
.
NoError
(
t
,
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment