From 48096f89eba2044c55164d1ddde94e8c72ab05aa Mon Sep 17 00:00:00 2001 From: Leonid Bogdanov Date: Fri, 17 May 2024 16:10:15 +1000 Subject: [PATCH] Check for target presence before adding it (#134) --- extra_script.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extra_script.py b/extra_script.py index 5fb4421..1189a37 100644 --- a/extra_script.py +++ b/extra_script.py @@ -61,7 +61,8 @@ def clean_microros_callback(*args, **kwargs): print("micro-ROS library cleaned!") os._exit(0) -global_env.AddCustomTarget("clean_microros", None, clean_microros_callback, title="Clean Micro-ROS", description="Clean Micro-ROS build environment") +if "clean_microros" not in global_env.get("__PIO_TARGETS", {}): + global_env.AddCustomTarget("clean_microros", None, clean_microros_callback, title="Clean Micro-ROS", description="Clean Micro-ROS build environment") def build_microros(*args, **kwargs): ##############################