Skip to content

Commit 1370900

Browse files
Merge pull request #818 from aashishc1988/default_mbed_app
Modify "mbed new" to create mbed_app.json with default content.
2 parents 92b2fc5 + bf07e0f commit 1370900

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

.circleci/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ commands:
133133
- change_mbed_os_version:
134134
version: "5.2.3"
135135
- check_inspection
136+
- run:
137+
name: Removing mbed_app.json for 5.1.5
138+
working_directory: integration_tests/supported-tests
139+
command: rm mbed_app.json
136140
- change_mbed_os_version:
137141
version: "5.1.5"
138142
- check_inspection

mbed/mbed.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import re
3838
import subprocess
3939
import os
40+
import json
4041
import platform
4142
import contextlib
4243
import shutil
@@ -221,6 +222,13 @@ def hide_progress(max_width=80):
221222
if sys.stdout.isatty():
222223
sys.stdout.write("\r%s\r" % (' ' * max_width))
223224

225+
def create_default_mbed_app():
226+
# Default data content
227+
data = {'target_overrides':{'K64F':{'platform.stdio-baud-rate': 9600}}}
228+
filehandler = open("mbed_app.json","w")
229+
json.dump(data, filehandler, indent=4)
230+
filehandler.close()
231+
224232
# Process execution
225233
class ProcessException(Exception):
226234
pass
@@ -2088,6 +2096,7 @@ def new(name, scm='git', program=False, library=False, mbedlib=False, create_onl
20882096
try:
20892097
with cd(d_path):
20902098
add(url, path=d, depth=depth, protocol=protocol, top=False)
2099+
create_default_mbed_app()
20912100
except Exception as e:
20922101
if os.path.isdir(os.path.join(d_path, d)):
20932102
rmtree_readonly(os.path.join(d_path, d))

0 commit comments

Comments
 (0)