Skip to content

Commit fc765e2

Browse files
hydevcodesupperthomas
authored andcommitted
[action] Recursive folder lookup attachconfig.yml
1 parent bdf5a1f commit fc765e2

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

tools/ci/bsp_buildings.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,15 @@ def build_bsp_attachconfig(bsp, attach_file):
162162
yml_files_content = []
163163
directory = os.path.join(rtt_root, 'bsp', bsp, '.ci/attachconfig')
164164
if os.path.exists(directory):
165-
for filename in os.listdir(directory):
166-
if filename.endswith('attachconfig.yml'):
167-
file_path = os.path.join(directory, filename)
168-
if os.path.exists(file_path):
169-
with open(file_path, 'r') as file:
170-
content = yaml.safe_load(file)
171-
yml_files_content.append(content)
172-
165+
for root, dirs, files in os.walk(directory):
166+
for filename in files:
167+
if filename.endswith('attachconfig.yml'):
168+
file_path = os.path.join(root, filename)
169+
if os.path.exists(file_path):
170+
with open(file_path, 'r') as file:
171+
content = yaml.safe_load(file)
172+
yml_files_content.append(content)
173+
173174
config_file = os.path.join(rtt_root, 'bsp', bsp, '.config')
174175

175176
for projects in yml_files_content:

0 commit comments

Comments
 (0)