core list
machine readable output is null
when no platforms are installed
#2690
Labels
conclusion: resolved
Issue was resolved
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
Describe the problem
arduino-cli core list --format json
outputs a machine readable list of the installed boards platforms.If no platforms are installed, the logical behavior is to output an empty array (
[]
).🐛 The behavior recently changed to outputting the inappropriate
null
instead of an empty array. This will break any code that parses this output which was designed for the previous behavior, when run in an environment where no platforms are installed.To reproduce
Set Up
Demo
🙂 The output is an empty array.
🐛 The output is the inappropriate
null
.ⓘ Note that the breaking change in the overall data format between the two Arduino CLI versions used in the demos, where the list of installed platforms is now provided under the
platforms
key of an object is intended, documented, reasonable, and not the subject of this issue report.Expected behavior
The list of platforms is always an array:
{ "platforms": [] }
Arduino CLI version
1.0.4
Operating system
Operating system version
Additional context
The regression occurred at ad5dacc (#2357).
Originally reported at arduino/compile-sketches#310
Issue checklist
The text was updated successfully, but these errors were encountered: