mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-06 12:45:00 +00:00
copy
This commit is contained in:
parent
0c5cd64b83
commit
22318a3160
1 changed files with 5 additions and 5 deletions
|
@ -18,7 +18,7 @@ def run_cmd(command, verbose=False):
|
||||||
|
|
||||||
def run_cmd_subprocess(command, verbose=False):
|
def run_cmd_subprocess(command, verbose=False):
|
||||||
if verbose:
|
if verbose:
|
||||||
print("run_cmd_subprocess:", command)
|
print("Using run_cmd_subprocess:", command)
|
||||||
try:
|
try:
|
||||||
process = subprocess.Popen(
|
process = subprocess.Popen(
|
||||||
command,
|
command,
|
||||||
|
@ -52,7 +52,7 @@ def run_cmd_pexpect(command, verbose=False):
|
||||||
:return: A tuple containing (exit_status, output)
|
:return: A tuple containing (exit_status, output)
|
||||||
"""
|
"""
|
||||||
if verbose:
|
if verbose:
|
||||||
print("run_cmd_pexpect:", command)
|
print("Using run_cmd_pexpect:", command)
|
||||||
|
|
||||||
output = BytesIO()
|
output = BytesIO()
|
||||||
|
|
||||||
|
@ -64,17 +64,17 @@ def run_cmd_pexpect(command, verbose=False):
|
||||||
# Use the SHELL environment variable, falling back to /bin/sh if not set
|
# Use the SHELL environment variable, falling back to /bin/sh if not set
|
||||||
shell = os.environ.get("SHELL", "/bin/sh")
|
shell = os.environ.get("SHELL", "/bin/sh")
|
||||||
if verbose:
|
if verbose:
|
||||||
print("shell:", shell)
|
print("With shell:", shell)
|
||||||
|
|
||||||
if os.path.exists(shell):
|
if os.path.exists(shell):
|
||||||
# Use the shell from SHELL environment variable
|
# Use the shell from SHELL environment variable
|
||||||
if verbose:
|
if verbose:
|
||||||
print("pexpect.spawn with shell:", shell)
|
print("Running pexpect.spawn with shell:", shell)
|
||||||
child = pexpect.spawn(shell, args=["-c", command], encoding="utf-8")
|
child = pexpect.spawn(shell, args=["-c", command], encoding="utf-8")
|
||||||
else:
|
else:
|
||||||
# Fall back to spawning the command directly
|
# Fall back to spawning the command directly
|
||||||
if verbose:
|
if verbose:
|
||||||
print("pexpect.spawn without shell")
|
print("Running pexpect.spawn without shell.")
|
||||||
child = pexpect.spawn(command, encoding="utf-8")
|
child = pexpect.spawn(command, encoding="utf-8")
|
||||||
|
|
||||||
# Transfer control to the user, capturing output
|
# Transfer control to the user, capturing output
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue