diff --git a/adafruit_shell.py b/adafruit_shell.py index 34b6f05..49cadc2 100644 --- a/adafruit_shell.py +++ b/adafruit_shell.py @@ -339,6 +339,8 @@ def move(self, source, destination): source = self.path(source) destination = self.path(destination) if os.path.exists(source): + if not os.path.isdir(source) and os.path.isdir(destination): + destination += os.sep + os.path.basename(source) shutil.move(source, destination) def copy(self, source, destination): @@ -351,7 +353,9 @@ def copy(self, source, destination): if os.path.isdir(source): shutil.copytree(source, destination) else: - shutil.copyfile(source, destination) + if os.path.isdir(destination): + destination += os.sep + os.path.basename(source) + shutil.copy(source, destination) def remove(self, location): """