tools/mpremote: Allow EDITOR environment variable to work on Windows.

This commit is contained in:
Tobias Thyrrestrup 2022-10-14 09:16:44 +02:00 committed by Damien George
parent f3e4c505d1
commit 2fcd93cdd0
1 changed files with 1 additions and 1 deletions
tools/mpremote/mpremote

View File

@ -174,7 +174,7 @@ def do_edit(state, args):
os.close(dest_fd)
state.pyb.fs_touch(src)
state.pyb.fs_get(src, dest, progress_callback=show_progress_bar)
if os.system("$EDITOR '%s'" % (dest,)) == 0:
if os.system('%s "%s"' % (os.getenv("EDITOR"), dest)) == 0:
state.pyb.fs_put(dest, src, progress_callback=show_progress_bar)
finally:
os.unlink(dest)