Merge pull request #14587 from saheerb/symlink_fix

create symlink for all sub examples which has mbed-os.lib
pull/14569/head
Martin Kojtal 2021-04-28 12:31:33 +01:00 committed by GitHub
commit 155d5f45a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -493,7 +493,16 @@ def symlink_mbedos(config, path, exp_filter):
for example in config['examples']:
if example['name'] not in exp_filter:
continue
for name in get_sub_examples_list(example):
# traverse the path and find directories with "mbed-os.lib"
dirs_with_mbed_os_lib = []
for root, dirs, files in os.walk(example['name']):
for the_file in files:
if the_file.endswith("mbed-os.lib"):
dirs_with_mbed_os_lib.append(root)
# symlink all sub directories with mbed-os.lib
for name in dirs_with_mbed_os_lib:
os.chdir(name)
logging.info("In folder '%s'" % name)
if os.path.exists("mbed-os.lib"):