Skip to content

Commit

Permalink
Merge pull request Significant-Gravitas#2318 from ezolenko/bugs/execu…
Browse files Browse the repository at this point in the history
…te_shell_popen

Fix for execute_shell_popen using WORKING_DIRECTORY
  • Loading branch information
BillSchumacher authored Apr 18, 2023
2 parents b5f1ba0 + a88113d commit 5752a46
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions autogpt/commands/execute_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()}'")

Expand Down

0 comments on commit 5752a46

Please sign in to comment.