Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Commit 2ca5ffc

Browse files
Use shutil.copy2, not Path.rename (#56)
1 parent 8e7e4fe commit 2ca5ffc

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

bak/commands/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,13 +270,11 @@ def bak_down_cmd(filename: Path,
270270
if not confirm:
271271
console.print("Cancelled.")
272272
return
273+
copy2(bakfile_entry.bakfile_loc, destination)
273274
if not keep_bakfile:
274-
Path(bakfile_entry.bakfile_loc).rename(destination)
275275
for entry in bakfile_entries:
276276
Path(entry.bakfile_loc).unlink(missing_ok=True)
277277
db_handler.del_bakfile_entry(entry)
278-
else:
279-
copy2(bakfile_entry.bakfile_loc, destination)
280278

281279

282280
def __remove_bakfiles(bakfile_entries):

0 commit comments

Comments
 (0)