Ensure instructions variable is always defined in cmd_run method

This commit is contained in:
Paul Gauthier (aider) 2024-07-29 17:11:31 -03:00
parent 23a9ade113
commit c0a2b8b57c

View file

@ -652,6 +652,7 @@ class Commands:
def cmd_run(self, args, add_on_nonzero_exit=False):
"Run a shell command and optionally add the output to the chat (alias: !)"
combined_output = None
instructions = None
try:
result = subprocess.run(
args,
@ -680,10 +681,8 @@ class Commands:
if response.lower() in ["yes", "y"]:
add = True
instructions = None
elif response.lower() in ["no", "n"]:
add = False
instructions = None
else:
add = True
instructions = response