Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools/utils: ensure default build profiles are processed first #9724

Merged
merged 1 commit into from Feb 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions tools/utils.py
Expand Up @@ -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))
Expand Down