File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 153
153
install_requirements = True
154
154
cache_repositories = True
155
155
156
+ mbed_app_file_name = "mbed_app.json"
157
+
156
158
# stores current working directory for recursive operations
157
159
cwd_root = ""
158
160
_cwd = os .getcwd ()
@@ -226,10 +228,10 @@ def hide_progress(max_width=80):
226
228
227
229
def create_default_mbed_app ():
228
230
# Default data content
229
- data = { 'target_overrides' :{ 'K64F' :{ 'platform.stdio-baud-rate' : 9600 }}}
230
- filehandler = open ( "mbed_app.json" , "w" )
231
- json . dump ( data , filehandler , indent = 4 )
232
- filehandler . close ( )
231
+ if not os . path . exists ( mbed_app_file_name ):
232
+ data = { 'target_overrides' :{ 'K64F' :{ 'platform.stdio-baud-rate' : 9600 }}}
233
+ with open ( mbed_app_file_name , "w" ) as mbed_app_file :
234
+ json . dump ( data , mbed_app_file , indent = 4 )
233
235
234
236
# Process execution
235
237
class ProcessException (Exception ):
You can’t perform that action at this time.
0 commit comments