From f4e876149671116bfddc8b8fa2b46ffd61a8dca5 Mon Sep 17 00:00:00 2001 From: Fallen_Breath Date: Sat, 24 Feb 2024 18:23:45 +0800 Subject: [PATCH] cli: do not touch existing files for the extract command do only what it should do --- prime_backup/cli/entrypoint.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/prime_backup/cli/entrypoint.py b/prime_backup/cli/entrypoint.py index e98c1be..6f65428 100644 --- a/prime_backup/cli/entrypoint.py +++ b/prime_backup/cli/entrypoint.py @@ -1,7 +1,6 @@ import argparse import enum import json -import shutil import sys from pathlib import Path from typing import Type @@ -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,