Skip to content

Commit 9d857c0

Browse files
Append profile name to default build dir with underscores, not as subdir.
Also, no append for default profile, since CI tools are sensitive to build dir, but all use default profile, so this preserves the prior behavior for them.
1 parent 8f31b1b commit 9d857c0

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

mbed/mbed.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2435,15 +2435,14 @@ def status_(ignore=False):
24352435

24362436
# Helper function for compile subcommand
24372437
def _safe_append_profile_to_build_path(build_path, profile):
2438-
append_str = 'DEFAULT'
2439-
24402438
if profile:
2441-
if isinstance(profile, basestring):
2442-
append_str = profile
2443-
else:
2444-
append_str = profile[0]
2439+
# profile is (or can be) a list, so just get the first element
2440+
if not isinstance(profile, basestring):
2441+
profile = profile[0]
24452442

2446-
build_path = os.path.join(build_path, os.path.splitext(os.path.basename(append_str))[0].upper())
2443+
if profile:
2444+
profile_name_without_extension = os.path.splitext(os.path.basename(profile))[0].upper()
2445+
build_path += '__' + profile_name_without_extension
24472446

24482447
return build_path
24492448

0 commit comments

Comments
 (0)