mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			tools/utils: ensure default build profiles are processed first
The command-line argument '--profile' looks for build profiles provided in mbed-os/tools/profiles/. If a directory name exists in the root folder with the same name as one of the profile names provided by default [e.g debug/develop/release], that directory is processed instead resulting in incorrect behavior. Fix this behavior by processing the default profiles first.pull/9724/head
							parent
							
								
									c07410d78c
								
							
						
					
					
						commit
						176b750257
					
				| 
						 | 
				
			
			@ -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))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue