Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions mbed/mbed.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@
install_requirements = True
cache_repositories = True

mbed_app_file_name = "mbed_app.json"

# stores current working directory for recursive operations
cwd_root = ""
_cwd = os.getcwd()
Expand Down Expand Up @@ -226,10 +228,10 @@ def hide_progress(max_width=80):

def create_default_mbed_app():
# Default data content
data = {'target_overrides':{'K64F':{'platform.stdio-baud-rate': 9600}}}
filehandler = open("mbed_app.json","w")
json.dump(data, filehandler, indent=4)
filehandler.close()
if not os.path.exists(mbed_app_file_name):
data = {'target_overrides':{'K64F':{'platform.stdio-baud-rate': 9600}}}
with open(mbed_app_file_name, "w") as mbed_app_file:
json.dump(data, mbed_app_file, indent=4)

# Process execution
class ProcessException(Exception):
Expand Down