Merge pull request #9724 from naveenkaje/tools_dir_with_profile_name

tools/utils: ensure default build profiles are processed first
pull/9728/head
Cruz Monrreal 2019-02-14 21:21:19 -06:00 committed by GitHub
commit 883b8b8f4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -495,10 +495,12 @@ def argparse_profile_filestring_type(string):
absolute path or a file name (expanded to
mbed-os/tools/profiles/<fname>.json) of a existing file"""
fpath = join(dirname(__file__), "profiles/{}.json".format(string))
if exists(string):
return string
elif exists(fpath):
# default profiles are searched first, local ones next.
if exists(fpath):
return fpath
elif exists(string):
return string
else:
raise argparse.ArgumentTypeError(
"{0} does not exist in the filesystem.".format(string))