Skip to content

Commit

Permalink
commands.extract:command_extract - only try to remove extract folder …
Browse files Browse the repository at this point in the history
…if it exists
  • Loading branch information
MatteoCampinoti94 committed Sep 27, 2024
1 parent e736fd7 commit 89826c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions digiarch/commands/extract/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ def command_extract(
event.log(ERROR, log_file, log_stdout)
raise
finally:
if not next(extractor.extract_folder.iterdir(), None):
rm_tree(extractor.extract_folder)
if (folder := extractor.extract_folder).is_dir() and not next(folder.iterdir(), None):
rm_tree(folder)

for path, original_path in extracted_files_paths:
extracted_file, file_history = identify_file(
Expand Down

0 comments on commit 89826c5

Please sign in to comment.