Skip to content

Commit

Permalink
Merge pull request #57 from bakfile/fix/bak-down-link-err
Browse files Browse the repository at this point in the history
Use shutil.copy2, not Path.rename (#56)
  • Loading branch information
ChanceNCounter authored Feb 16, 2021
2 parents 9147c40 + 2ca5ffc commit 2970dda
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions bak/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,11 @@ def bak_down_cmd(filename: Path,
if not confirm:
console.print("Cancelled.")
return
copy2(bakfile_entry.bakfile_loc, destination)
if not keep_bakfile:
Path(bakfile_entry.bakfile_loc).rename(destination)
for entry in bakfile_entries:
Path(entry.bakfile_loc).unlink(missing_ok=True)
db_handler.del_bakfile_entry(entry)
else:
copy2(bakfile_entry.bakfile_loc, destination)


def __remove_bakfiles(bakfile_entries):
Expand Down

0 comments on commit 2970dda

Please sign in to comment.