mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-17 22:14:28 +01:00
Call subprocess.run with shell=True
This commit is contained in:
@@ -54,7 +54,6 @@ def execute_python_file(file):
|
|||||||
|
|
||||||
def exec_shell(command_line):
|
def exec_shell(command_line):
|
||||||
|
|
||||||
args = command_line.split()
|
|
||||||
old_dir = os.getcwd()
|
old_dir = os.getcwd()
|
||||||
|
|
||||||
workdir = os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', WORKSPACE_FOLDER))
|
workdir = os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', WORKSPACE_FOLDER))
|
||||||
@@ -63,7 +62,7 @@ def exec_shell(command_line):
|
|||||||
|
|
||||||
os.chdir(workdir)
|
os.chdir(workdir)
|
||||||
|
|
||||||
result = subprocess.run(args, capture_output=True)
|
result = subprocess.run(command_line, capture_output=True, shell=True)
|
||||||
output = f"STDOUT:\n{result.stdout}\nSTDERR:\n{result.stderr}";
|
output = f"STDOUT:\n{result.stdout}\nSTDERR:\n{result.stderr}";
|
||||||
|
|
||||||
os.chdir(old_dir)
|
os.chdir(old_dir)
|
||||||
|
|||||||
Reference in New Issue
Block a user