mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 09:14:59 +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)
|
filepath = write_temp_file(input_data, suffix)
|
||||||
command_parts = discover_editor(editor)
|
command_parts = discover_editor(editor)
|
||||||
command_parts.append(filepath)
|
command_parts.append(filepath)
|
||||||
dump(command_parts)
|
command_str = " ".join(shlex.quote(part) for part in command_parts)
|
||||||
subprocess.call(command_parts) # why does adding shell=True launch the editor without the filepath? ai?
|
dump(command_str)
|
||||||
|
subprocess.call(command_str, shell=True)
|
||||||
with open(filepath, "r") as f:
|
with open(filepath, "r") as f:
|
||||||
output_data = f.read()
|
output_data = f.read()
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue