Skip to content

Commit

Permalink
remove extra ask_yes_no for deleting files (#402)
Browse files Browse the repository at this point in the history
  • Loading branch information
granawkins authored Dec 16, 2023
1 parent 10b4276 commit 1bd9666
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions mentat/code_file_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,11 @@ async def write_changes_to_files(
)

if file_edit.is_deletion:
stream.send(
f"Are you sure you want to delete {display_path}?",
color="red",
)
if await ask_yes_no(default_yes=False):
stream.send(f"Deleting {display_path}...", color="red")
# We use the current lines rather than the stored lines for undo
file_edit.previous_file_lines = self.read_file(file_edit.file_path)
self.delete_file(file_edit.file_path)
applied_edits.append(file_edit)
else:
stream.send(f"Not deleting {display_path}", color="green")
stream.send(f"Deleting {display_path}...", color="red")
# We use the current lines rather than the stored lines for undo
file_edit.previous_file_lines = self.read_file(file_edit.file_path)
self.delete_file(file_edit.file_path)
applied_edits.append(file_edit)
continue

if not file_edit.is_creation:
Expand Down

0 comments on commit 1bd9666

Please sign in to comment.