Browse Source

Show true delete in dryrun

master
Raphael Roberts 5 years ago
parent
commit
78cc244955
  1. 5
      openwrt_backup/__init__.py

5
openwrt_backup/__init__.py

@ -14,7 +14,10 @@ from openwrt_backup.prune import get_all_but_last_n
def do_prune(dest_path: Path, n: int, dry, hostname=None):
to_delete = get_all_but_last_n(dest_path, n, hostname)
if dry:
to_delete = get_all_but_last_n(dest_path, n - 1, hostname)
else:
to_delete = get_all_but_last_n(dest_path, n, hostname)
for f in to_delete:
if dry:
print(f"Deleting: {f}")

Loading…
Cancel
Save