Skip to content

Commit

Permalink
cli: do not touch existing files for the extract command
Browse files Browse the repository at this point in the history
do only what it should do
  • Loading branch information
Fallen-Breath committed Feb 24, 2024
1 parent 77c2165 commit f4e8761
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions prime_backup/cli/entrypoint.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import argparse
import enum
import json
import shutil
import sys
from pathlib import Path
from typing import Type
Expand Down Expand Up @@ -189,12 +188,6 @@ def cmd_extract(self):
logger.error('Unexpected file type, expected {}, but found {} for the to-be-extracted file'.format(self.args.type, file.file_type.name))
sys.exit(2)

dest_path = output_path / file_path.name
if dest_path.is_file():
dest_path.unlink()
elif dest_path.is_dir():
shutil.rmtree(dest_path)

ExportBackupToDirectoryAction(
self.args.backup_id, output_path,
child_to_export=file_path,
Expand Down

0 comments on commit f4e8761

Please sign in to comment.