Create parent directories if necessary
This commit is contained in:
parent
c47c481731
commit
e17d4054d5
@ -18,4 +18,5 @@ class MoveInstruction(Instruction):
|
|||||||
if self.new_path.exists():
|
if self.new_path.exists():
|
||||||
raise FileExistsError("New path already exists, not moving anything")
|
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)
|
self.old_path.rename(self.new_path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user