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 32
32
stm32_url_base = "https://github.com/stm32duino/BoardManagerFiles/raw/main/"
33
33
stm32_url = f"{ stm32_url_base } package_stmicroelectronics_index.json"
34
34
sketches_path_list = []
35
+ search_path_list = []
35
36
default_build_output_dir = tempdir / "build_arduinoCliOutput"
36
37
build_output_dir = tempdir / f"build_arduinoCliOutput{ build_id } "
37
38
build_output_cache_dir = build_output_dir / "cache"
@@ -154,6 +155,7 @@ def check_config():
154
155
global arduino_cli_version
155
156
global arduino_cli_path
156
157
global sketches_path_list
158
+ global search_path_list
157
159
global build_output_dir
158
160
global root_output_dir
159
161
global output_dir
@@ -257,6 +259,13 @@ def check_config():
257
259
else :
258
260
print ("No user directory!" )
259
261
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 ))
260
269
else :
261
270
print ("No arduino-cli config!" )
262
271
quit (1 )
@@ -430,7 +439,7 @@ def find_inos():
430
439
# key: path, value: name
431
440
if args .sketches :
432
441
arg_sketch_pattern = re .compile (args .sketches , re .IGNORECASE )
433
- for spath in sketches_path_list :
442
+ for spath in search_path_list :
434
443
for spath_object in spath .glob ("**/*.[ip][nd][oe]" ):
435
444
if args .sketches :
436
445
if arg_sketch_pattern .search (str (spath_object )) is None :
You can’t perform that action at this time.
0 commit comments