mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
fix: Remove unnecessary debug statements and improve shell command confirmation prompt
This commit is contained in:
parent
7bcd6d4ebb
commit
8d0c2b1667
1 changed files with 3 additions and 6 deletions
|
@ -25,22 +25,19 @@ class EditBlockCoder(Coder):
|
||||||
# might raise ValueError for malformed ORIG/UPD blocks
|
# might raise ValueError for malformed ORIG/UPD blocks
|
||||||
edits = list(find_original_update_blocks(content, self.fence))
|
edits = list(find_original_update_blocks(content, self.fence))
|
||||||
|
|
||||||
dump(edits)
|
|
||||||
|
|
||||||
return edits
|
return edits
|
||||||
|
|
||||||
def apply_edits(self, edits):
|
def apply_edits(self, edits):
|
||||||
failed = []
|
failed = []
|
||||||
passed = []
|
passed = []
|
||||||
|
|
||||||
dump(edits)
|
|
||||||
|
|
||||||
for edit in edits:
|
for edit in edits:
|
||||||
if edit[0] is None:
|
if edit[0] is None:
|
||||||
edit = edit[1]
|
edit = edit[1]
|
||||||
# This is a shell command
|
# This is a shell command
|
||||||
self.io.tool_output(f"Shell command: {edit}")
|
self.io.tool_output()
|
||||||
if self.io.confirm_ask("Do you want to run this command?"):
|
self.io.tool_output(f"Command: {edit.strip()}")
|
||||||
|
if self.io.confirm_ask("Do you want to run this suggested shell command?"):
|
||||||
try:
|
try:
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
edit, shell=True, check=True, text=True, capture_output=True
|
edit, shell=True, check=True, text=True, capture_output=True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue