Skip to content

Commit 6116836

Browse files
committed
fix(arduino-cli): support 1.x version
Some data format have changed. Signed-off-by: Frederic Pillon <[email protected]>
1 parent e194ab8 commit 6116836

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Diff for: CI/build/arduino-cli.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,11 @@ def check_config():
297297
else:
298298
cli_config = json.loads(output)
299299
if cli_config is not None:
300+
# Since arduino-cli 1.x new level "config"
301+
if not arduino_cli_ver.startswith("0."):
302+
print(cli_config)
303+
cli_config_tmp = cli_config["config"]
304+
cli_config = cli_config_tmp
300305
if cli_config["directories"]["data"] is not None:
301306
sketches_path_list.append(Path(cli_config["directories"]["data"]))
302307
else:
@@ -526,7 +531,12 @@ def find_board():
526531
print(e.stdout.decode("utf-8"))
527532
quit(e.returncode)
528533
else:
529-
fqbn_list_tmp = [board["fqbn"] for board in json.loads(output)]
534+
boards = json.loads(output)
535+
# Since arduino-cli 1.x new level "boards" and is a dict
536+
if not arduino_cli_ver.startswith("0."):
537+
print(boards)
538+
boards = boards["boards"]
539+
fqbn_list_tmp = [board["fqbn"] for board in boards]
530540
if not len(fqbn_list_tmp):
531541
print(f"No boards found for {arduino_platform}")
532542
quit(1)

0 commit comments

Comments
 (0)