mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 14:55:00 +00:00
Handled Issue #114
Handled the UnboundLocalError tat occurs when wrong prams are passed to the `/run` command
This commit is contained in:
parent
e7692fc9d1
commit
a2d8bed155
1 changed files with 4 additions and 0 deletions
|
@ -333,6 +333,7 @@ class Commands:
|
||||||
|
|
||||||
def cmd_run(self, args):
|
def cmd_run(self, args):
|
||||||
"Run a shell command and optionally add the output to the chat"
|
"Run a shell command and optionally add the output to the chat"
|
||||||
|
combined_output = None
|
||||||
try:
|
try:
|
||||||
parsed_args = shlex.split(args)
|
parsed_args = shlex.split(args)
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
|
@ -342,6 +343,9 @@ class Commands:
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.io.tool_error(f"Error running command: {e}")
|
self.io.tool_error(f"Error running command: {e}")
|
||||||
|
|
||||||
|
if combined_output is None:
|
||||||
|
return
|
||||||
|
|
||||||
self.io.tool_output(combined_output)
|
self.io.tool_output(combined_output)
|
||||||
|
|
||||||
if self.io.confirm_ask("Add the output to the chat?", default="y"):
|
if self.io.confirm_ask("Add the output to the chat?", default="y"):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue