tools/mpremote: Handle cp without destination.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
Jim Mussared 2023-05-31 11:16:34 +10:00 committed by Damien George
parent 46715e370d
commit b6b19798c2

View File

@ -686,6 +686,10 @@ def filesystem_command(pyb, args, progress_callback=None, verbose=False):
args = args[1:]
try:
if cmd == "cp":
if len(args) == 1:
raise PyboardError(
"cp: missing destination file operand after '{}'".format(args[0])
)
srcs = args[:-1]
dest = args[-1]
if dest.startswith(":"):