mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #9724 from naveenkaje/tools_dir_with_profile_name
tools/utils: ensure default build profiles are processed firstpull/9728/head
commit
883b8b8f4f
|
@ -495,10 +495,12 @@ def argparse_profile_filestring_type(string):
|
||||||
absolute path or a file name (expanded to
|
absolute path or a file name (expanded to
|
||||||
mbed-os/tools/profiles/<fname>.json) of a existing file"""
|
mbed-os/tools/profiles/<fname>.json) of a existing file"""
|
||||||
fpath = join(dirname(__file__), "profiles/{}.json".format(string))
|
fpath = join(dirname(__file__), "profiles/{}.json".format(string))
|
||||||
if exists(string):
|
|
||||||
return string
|
# default profiles are searched first, local ones next.
|
||||||
elif exists(fpath):
|
if exists(fpath):
|
||||||
return fpath
|
return fpath
|
||||||
|
elif exists(string):
|
||||||
|
return string
|
||||||
else:
|
else:
|
||||||
raise argparse.ArgumentTypeError(
|
raise argparse.ArgumentTypeError(
|
||||||
"{0} does not exist in the filesystem.".format(string))
|
"{0} does not exist in the filesystem.".format(string))
|
||||||
|
|
Loading…
Reference in New Issue