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 265ac4c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion CI/build/arduino-cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,12 @@ 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
print(cli_config)
if cli_config["directories"]["data"] is not None:
sketches_path_list.append(Path(cli_config["directories"]["data"]))
else:
Expand Down Expand Up @@ -526,7 +532,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 265ac4c

Please sign in to comment.