From a88113de33c8764c015e800aa09b29acbfd10f42 Mon Sep 17 00:00:00 2001 From: Eugene Zolenko Date: Mon, 17 Apr 2023 23:02:07 -0600 Subject: [PATCH] Fix for execute_shell_popen using WORKING_DIRECTORY Looks like things got changed to WORKSPACE_PATH recently? --- autogpt/commands/execute_code.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/autogpt/commands/execute_code.py b/autogpt/commands/execute_code.py index a524081e0f0f..95ba612264fc 100644 --- a/autogpt/commands/execute_code.py +++ b/autogpt/commands/execute_code.py @@ -125,10 +125,9 @@ def execute_shell_popen(command_line) -> str: str: Description of the fact that the process started and its id """ current_dir = os.getcwd() - - if WORKING_DIRECTORY not in current_dir: # Change dir into workspace if necessary - work_dir = os.path.join(os.getcwd(), WORKING_DIRECTORY) - os.chdir(work_dir) + # Change dir into workspace if necessary + if str(WORKSPACE_PATH) not in current_dir: + os.chdir(WORKSPACE_PATH) print(f"Executing command '{command_line}' in working directory '{os.getcwd()}'")