diff --git a/CI/build/arduino-cli.py b/CI/build/arduino-cli.py index a6ba736330..4e57fe8946 100644 --- a/CI/build/arduino-cli.py +++ b/CI/build/arduino-cli.py @@ -237,7 +237,17 @@ def check_config(): except subprocess.CalledProcessError as e: print(f"'{' '.join(e.cmd)}' failed with code: {e.returncode}!") print(e.stdout.decode("utf-8")) - quit(e.returncode) + # Ensure a configuration exists + try: + print("Try to create configuration file...") + output = subprocess.check_output( + [arduino_cli, "config", "init", "--additional-urls", stm32_url], + stderr=subprocess.STDOUT, + ).decode("utf-8") + except subprocess.CalledProcessError as e: + print(f"'{' '.join(e.cmd)}' failed with code: {e.returncode}!") + print(e.stdout.decode("utf-8")) + quit(e.returncode) else: if stm32_url not in output.decode("utf-8"): # Add it to the config