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 6116836
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion CI/build/arduino-cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,11 @@ def check_config():
else:
cli_config = json.loads(output)
if cli_config is not None:
# Since arduino-cli 1.x new level "config"
if not arduino_cli_ver.startswith("0."):
print(cli_config)
cli_config_tmp = cli_config["config"]
cli_config = cli_config_tmp
if cli_config["directories"]["data"] is not None:
sketches_path_list.append(Path(cli_config["directories"]["data"]))
else:
Expand Down Expand Up @@ -526,7 +531,12 @@ 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 not arduino_cli_ver.startswith("0."):
print(boards)
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 6116836

Please sign in to comment.