Skip to content

Commit

Permalink
fix(arduino-cli): support 1.x version
Browse files Browse the repository at this point in the history
Some data format have changed.

Signed-off-by: Frederic Pillon <[email protected]>
  • Loading branch information
fpistm committed Jul 2, 2024
1 parent e194ab8 commit 35bf672
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion CI/build/arduino-cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ def check_config():
quit(e.returncode)
else:
cli_config = json.loads(output)
# Since arduino-cli 1.x new level "config"
if "config" in cli_config.keys():
cli_config = cli_config["config"]
if cli_config is not None:
if cli_config["directories"]["data"] is not None:
sketches_path_list.append(Path(cli_config["directories"]["data"]))
Expand Down Expand Up @@ -526,7 +529,11 @@ def find_board():
print(e.stdout.decode("utf-8"))
quit(e.returncode)
else:
fqbn_list_tmp = [board["fqbn"] for board in json.loads(output)]
boards = json.loads(output)
# Since arduino-cli 1.x new level "boards" and is a dict
if type(boards) is dict:
boards = boards["boards"]
fqbn_list_tmp = [board["fqbn"] for board in boards]
if not len(fqbn_list_tmp):
print(f"No boards found for {arduino_platform}")
quit(1)
Expand Down

0 comments on commit 35bf672

Please sign in to comment.