mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00
refactor: Update subprocess call to use shell=True with properly quoted command string
This commit is contained in:
parent
0415de853b
commit
3714d554df
1 changed files with 3 additions and 2 deletions
|
@ -131,8 +131,9 @@ def pipe_editor(input_data="", suffix=None, editor=None):
|
|||
filepath = write_temp_file(input_data, suffix)
|
||||
command_parts = discover_editor(editor)
|
||||
command_parts.append(filepath)
|
||||
dump(command_parts)
|
||||
subprocess.call(command_parts) # why does adding shell=True launch the editor without the filepath? ai?
|
||||
command_str = " ".join(shlex.quote(part) for part in command_parts)
|
||||
dump(command_str)
|
||||
subprocess.call(command_str, shell=True)
|
||||
with open(filepath, "r") as f:
|
||||
output_data = f.read()
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue