File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 3232stm32_url_base = "https://github.com/stm32duino/BoardManagerFiles/raw/main/"
3333stm32_url = f"{ stm32_url_base } package_stmicroelectronics_index.json"
3434sketches_path_list = []
35+ search_path_list = []
3536default_build_output_dir = tempdir / "build_arduinoCliOutput"
3637build_output_dir = tempdir / f"build_arduinoCliOutput{ build_id } "
3738build_output_cache_dir = build_output_dir / "cache"
@@ -154,6 +155,7 @@ def check_config():
154155 global arduino_cli_version
155156 global arduino_cli_path
156157 global sketches_path_list
158+ global search_path_list
157159 global build_output_dir
158160 global root_output_dir
159161 global output_dir
@@ -257,6 +259,13 @@ def check_config():
257259 else :
258260 print ("No user directory!" )
259261 quit (1 )
262+ # Fill search_path_list to avoid search on the same path
263+ sorted_spl = sorted (set (sketches_path_list ))
264+ search_path_list = []
265+ while sorted_spl :
266+ p = sorted_spl .pop (0 )
267+ if not any (root in p .parents for root in search_path_list ):
268+ search_path_list .append (Path (p ))
260269 else :
261270 print ("No arduino-cli config!" )
262271 quit (1 )
@@ -430,7 +439,7 @@ def find_inos():
430439 # key: path, value: name
431440 if args .sketches :
432441 arg_sketch_pattern = re .compile (args .sketches , re .IGNORECASE )
433- for spath in sketches_path_list :
442+ for spath in search_path_list :
434443 for spath_object in spath .glob ("**/*.[ip][nd][oe]" ):
435444 if args .sketches :
436445 if arg_sketch_pattern .search (str (spath_object )) is None :
You can’t perform that action at this time.
0 commit comments