Skip to content

Commit 60ee2ae

Browse files
committed
ci(arduino_cli): workaround to follow simlink
Due to issue with Path.glob() which does not follow symlink use glob.glob See: https://bugs.python.org/issue33428 Signed-off-by: Frederic Pillon <[email protected]>
1 parent f779d6a commit 60ee2ae

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

CI/build/arduino-cli.py

+15-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import collections
33
import concurrent.futures
44
from datetime import timedelta
5+
from glob import glob
56
import json
67
import os
78
from packaging import version
@@ -440,12 +441,22 @@ def find_inos():
440441
if args.sketches:
441442
arg_sketch_pattern = re.compile(args.sketches, re.IGNORECASE)
442443
for spath in search_path_list:
443-
for spath_object in spath.glob("**/*.[ip][nd][oe]"):
444+
# Due to issue with Path.glob() which does not follow symlink
445+
# use glob.glob
446+
# See: https://bugs.python.org/issue33428
447+
# for spath_object in spath.glob("**/*.[ip][nd][oe]"):
448+
# if args.sketches:
449+
# if arg_sketch_pattern.search(str(spath_object)) is None:
450+
# continue
451+
# if spath_object.is_file():
452+
# sketch_list.append(spath_object.parent)
453+
for sk_ino in glob(str(spath / "**" / "*.[ip][nd][oe]"), recursive=True):
444454
if args.sketches:
445-
if arg_sketch_pattern.search(str(spath_object)) is None:
455+
if arg_sketch_pattern.search(sk_ino) is None:
446456
continue
447-
if spath_object.is_file():
448-
sketch_list.append(spath_object.parent)
457+
p_ino = Path(sk_ino)
458+
if p_ino.is_file():
459+
sketch_list.append(p_ino.parent)
449460
sketch_list = sorted(set(sketch_list))
450461

451462

0 commit comments

Comments
 (0)