kopia lustrzana https://github.com/micropython/micropython
tools/mpremote: Add "umount" command.
Signed-off-by: Damien George <damien@micropython.org>pull/8347/head
rodzic
ad1f523e7e
commit
d6564a3159
|
@ -135,6 +135,12 @@ The full list of supported commands are:
|
||||||
|
|
||||||
$ mpremote mount <local-dir>
|
$ 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.
|
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)"),
|
"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"),
|
"soft-reset": (False, True, 0, "perform a soft-reset of the device"),
|
||||||
"mount": (True, False, 1, "mount local directory on device"),
|
"mount": (True, False, 1, "mount local directory on device"),
|
||||||
|
"umount": (True, False, 0, "unmount the local directory"),
|
||||||
"repl": (
|
"repl": (
|
||||||
False,
|
False,
|
||||||
True,
|
True,
|
||||||
|
@ -493,6 +494,8 @@ def main():
|
||||||
path = args.pop(0)
|
path = args.pop(0)
|
||||||
pyb.mount_local(path)
|
pyb.mount_local(path)
|
||||||
print(f"Local directory {path} is mounted at /remote")
|
print(f"Local directory {path} is mounted at /remote")
|
||||||
|
elif cmd == "umount":
|
||||||
|
pyb.umount_local()
|
||||||
elif cmd in ("exec", "eval", "run"):
|
elif cmd in ("exec", "eval", "run"):
|
||||||
follow = True
|
follow = True
|
||||||
if args[0] == "--no-follow":
|
if args[0] == "--no-follow":
|
||||||
|
|
|
@ -687,3 +687,4 @@ class PyboardExtended(Pyboard):
|
||||||
if self.mounted:
|
if self.mounted:
|
||||||
self.exec_('uos.umount("/remote")')
|
self.exec_('uos.umount("/remote")')
|
||||||
self.mounted = False
|
self.mounted = False
|
||||||
|
self.serial = self.serial.orig_serial
|
||||||
|
|
Ładowanie…
Reference in New Issue