From 1a0a600fc76913b6f40617825bb4111ebfd5e501 Mon Sep 17 00:00:00 2001 From: Jakob Moser Date: Wed, 21 May 2025 14:39:27 +0200 Subject: [PATCH] Implement delete instruction --- .../deduplicate/instructions/DeleteInstruction.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/karaokatalog/deduplicate/instructions/DeleteInstruction.py b/karaokatalog/deduplicate/instructions/DeleteInstruction.py index 1f6fa75..e20996b 100644 --- a/karaokatalog/deduplicate/instructions/DeleteInstruction.py +++ b/karaokatalog/deduplicate/instructions/DeleteInstruction.py @@ -1,11 +1,15 @@ from dataclasses import dataclass +from pathlib import Path from karaokatalog.deduplicate.instructions.Instruction import Instruction @dataclass(frozen=True) class DeleteInstruction(Instruction): - # TODO Add file to delete + """ + Deletes the given path (might point to a file, a folder or a link), no questions asked. + """ + path_to_delete: Path def __call__(self) -> None: - pass # TODO Implement + self.path_to_delete.unlink()