tools/mpremote: Add "umount" command.
Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
parent
ad1f523e7e
commit
d6564a3159
|
@ -135,6 +135,12 @@ The full list of supported commands are:
|
|||
|
||||
$ mpremote mount <local-dir>
|
||||
|
||||
- unmount the local directory from the remote device:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ mpremote umount
|
||||
|
||||
Multiple commands can be specified and they will be run sequentially.
|
||||
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ _COMMANDS = {
|
|||
"resume": (False, False, 0, "resume a previous mpremote session (will not auto soft-reset)"),
|
||||
"soft-reset": (False, True, 0, "perform a soft-reset of the device"),
|
||||
"mount": (True, False, 1, "mount local directory on device"),
|
||||
"umount": (True, False, 0, "unmount the local directory"),
|
||||
"repl": (
|
||||
False,
|
||||
True,
|
||||
|
@ -493,6 +494,8 @@ def main():
|
|||
path = args.pop(0)
|
||||
pyb.mount_local(path)
|
||||
print(f"Local directory {path} is mounted at /remote")
|
||||
elif cmd == "umount":
|
||||
pyb.umount_local()
|
||||
elif cmd in ("exec", "eval", "run"):
|
||||
follow = True
|
||||
if args[0] == "--no-follow":
|
||||
|
|
|
@ -687,3 +687,4 @@ class PyboardExtended(Pyboard):
|
|||
if self.mounted:
|
||||
self.exec_('uos.umount("/remote")')
|
||||
self.mounted = False
|
||||
self.serial = self.serial.orig_serial
|
||||
|
|
Loading…
Reference in New Issue