Skip to content

Commit 2970dda

Browse files
Merge pull request #57 from bakfile/fix/bak-down-link-err
Use shutil.copy2, not Path.rename (#56)
2 parents 9147c40 + 2ca5ffc commit 2970dda

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)