From e17d4054d54800f9c5546c739466fc88eb171ebf Mon Sep 17 00:00:00 2001 From: Jakob Moser Date: Sun, 1 Jun 2025 13:21:41 +0200 Subject: [PATCH] Create parent directories if necessary --- karaokatalog/instructions/MoveInstruction.py | 1 + 1 file changed, 1 insertion(+) diff --git a/karaokatalog/instructions/MoveInstruction.py b/karaokatalog/instructions/MoveInstruction.py index 5fb04ff..83a74c3 100644 --- a/karaokatalog/instructions/MoveInstruction.py +++ b/karaokatalog/instructions/MoveInstruction.py @@ -18,4 +18,5 @@ class MoveInstruction(Instruction): if self.new_path.exists(): raise FileExistsError("New path already exists, not moving anything") + self.new_path.parent.mkdir(exist_ok=True, parents=True) self.old_path.rename(self.new_path)