Skip to content

Commit 883b8b8

Browse files
author
Cruz Monrreal
authored
Merge pull request #9724 from naveenkaje/tools_dir_with_profile_name
tools/utils: ensure default build profiles are processed first
2 parents 67abaf5 + 176b750 commit 883b8b8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tools/utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -495,10 +495,12 @@ def argparse_profile_filestring_type(string):
495495
absolute path or a file name (expanded to
496496
mbed-os/tools/profiles/<fname>.json) of a existing file"""
497497
fpath = join(dirname(__file__), "profiles/{}.json".format(string))
498-
if exists(string):
499-
return string
500-
elif exists(fpath):
498+
499+
# default profiles are searched first, local ones next.
500+
if exists(fpath):
501501
return fpath
502+
elif exists(string):
503+
return string
502504
else:
503505
raise argparse.ArgumentTypeError(
504506
"{0} does not exist in the filesystem.".format(string))

0 commit comments

Comments
 (0)