79693800

Date: 2025-07-08 07:12:50
Score: 0.5
Natty:
Report link

This is late, but the answers I've seen so far assume an oversimplistic input of platformio.ini

First, you want to let platformio itself parse that file, THEN let it hand it to you in a machine-readable format. You can do this as a text or as JSON, which is then trivial to parse with 'jq'.

`
$ pio project config  | grep "^env"

env
env:demo
env:m5demo
env:m5plusdemo
env:m5stackdemo
`

Or via jq

` $  pio project config --json-output | jq '.[][0]' | head

"platformio"
"base"
"remote_flags"
"dev_adafruit_feather"
"dev_esp32"
"dev_esp32-s3"
"dev_heltec_wifi"
"dev_heltec_wifi_v2"
"dev_heltec_wifi_v3" `

NOW you have regularized data that you can parse into an array with readarray and friends.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Robert L