Skip to content

Commit

Permalink
Merge pull request #80 from bakfile/hotfix/confirm-index-not-updated
Browse files Browse the repository at this point in the history
  • Loading branch information
ChanceNCounter authored Oct 7, 2021
2 parents 8a66f68 + 5517547 commit 9433ed4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bak/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
BAK_VERSION = "0.2.2a4"
BAK_VERSION = "0.2.2a5"
7 changes: 2 additions & 5 deletions bak/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,9 @@ def __keep_bakfiles(bakfile_entry, bakfile_entries, new_destination, bakfile_num
keep_all = not bakfile_numbers_to_keep
if not keep_all:
baks_to_remove = []
click.echo(f"Indeed, delete baks other than {bakfile_numbers_to_keep}")
for i, entry in enumerate(bakfile_entries):
if (i + 1) not in bakfile_numbers_to_keep:
baks_to_remove.append(bakfile_entries[i])
click.echo(bakfile_numbers_to_keep)
click.echo(bakfile_entries)
click.echo(baks_to_remove)
__remove_bakfiles(baks_to_remove)


Expand Down Expand Up @@ -450,6 +446,7 @@ def bak_down_cmd(filename: Path,
if not bakfile_entry:
console.print("Cancelled.")
return
index = bakfile_number-1
else:
try:
bakfile_entry, index = __do_select_bakfile(bakfile_entries, return_index=True) if len(
Expand Down Expand Up @@ -508,7 +505,7 @@ def bak_down_cmd(filename: Path,

multiples = bool(len(bakfile_entries))
restore_from = f"{index + 1}" \
if multiples or index != 0 \
if (multiples or index != 0) \
else (f"{bakfile_number}" if bakfile_number else '')
confirm_prompt += f" from bakfile #{restore_from}" if restore_from else ''

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'rich==9.1.0']

setup(name='bak',
version='0.2.2a4',
version='0.2.2a5',
description='the .bak manager',
author='ChanceNCounter',
author_email='[email protected]',
Expand Down

0 comments on commit 9433ed4

Please sign in to comment.