mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 14:58:12 +00:00
fix(build): tolerate control chars in pio project config JSON dump
get_platform_for_env() in build.sh parses `pio project config --json-output` with Python's strict json.load(), which rejects literal control characters inside string values. Depending on the installed pio version, a build_flags value can embed one there, breaking env-name lookup with "Invalid control character" before the actual build even starts. strict=False accepts it, same as a lenient JSON consumer would for a non-conforming producer. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2
build.sh
2
build.sh
@@ -96,7 +96,7 @@ get_platform_for_env() {
|
|||||||
local env_name=$1
|
local env_name=$1
|
||||||
echo "$PIO_CONFIG_JSON" | python3 -c "
|
echo "$PIO_CONFIG_JSON" | python3 -c "
|
||||||
import sys, json, re
|
import sys, json, re
|
||||||
data = json.load(sys.stdin)
|
data = json.load(sys.stdin, strict=False)
|
||||||
for section, options in data:
|
for section, options in data:
|
||||||
if section == 'env:$env_name':
|
if section == 'env:$env_name':
|
||||||
for key, value in options:
|
for key, value in options:
|
||||||
|
|||||||
Reference in New Issue
Block a user