[action] Recursive folder lookup attachconfig.yml

This commit is contained in:
hydevcode 2024-11-05 15:23:14 +08:00 committed by Supper Thomas
parent bdf5a1fb09
commit fc765e2f32
1 changed files with 9 additions and 8 deletions

View File

@ -162,14 +162,15 @@ if __name__ == "__main__":
yml_files_content = [] yml_files_content = []
directory = os.path.join(rtt_root, 'bsp', bsp, '.ci/attachconfig') directory = os.path.join(rtt_root, 'bsp', bsp, '.ci/attachconfig')
if os.path.exists(directory): if os.path.exists(directory):
for filename in os.listdir(directory): for root, dirs, files in os.walk(directory):
if filename.endswith('attachconfig.yml'): for filename in files:
file_path = os.path.join(directory, filename) if filename.endswith('attachconfig.yml'):
if os.path.exists(file_path): file_path = os.path.join(root, filename)
with open(file_path, 'r') as file: if os.path.exists(file_path):
content = yaml.safe_load(file) with open(file_path, 'r') as file:
yml_files_content.append(content) content = yaml.safe_load(file)
yml_files_content.append(content)
config_file = os.path.join(rtt_root, 'bsp', bsp, '.config') config_file = os.path.join(rtt_root, 'bsp', bsp, '.config')
for projects in yml_files_content: for projects in yml_files_content: