Implement move instruction

This commit is contained in:
2025-06-01 10:58:40 +02:00
parent f2c0e5a4f7
commit 3d9f8d46ee
+5 -1
View File
@@ -1,3 +1,4 @@
import shutil
from dataclasses import dataclass from dataclasses import dataclass
from pathlib import Path from pathlib import Path
@@ -15,4 +16,7 @@ class MoveInstruction(Instruction):
new_path: Path new_path: Path
def __call__(self) -> None: def __call__(self) -> None:
raise NotImplementedError() # TODO if self.new_path.exists():
raise FileExistsError("New path already exists, not moving anything")
shutil.move(self.old_path, self.new_path)