From 5256d977048689904daac59c81bf91da4dbd26e8 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Tue, 30 May 2023 09:17:28 -0400 Subject: [PATCH] fix auto-gpt 0.3.1 --- projects/agpt.co/auto-gpt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/projects/agpt.co/auto-gpt b/projects/agpt.co/auto-gpt index 2db3baa7..d667c7b2 100755 --- a/projects/agpt.co/auto-gpt +++ b/projects/agpt.co/auto-gpt @@ -1,4 +1,18 @@ #!/usr/bin/python +import os + +# Get the XDG base directory path +xdg_base_dir = os.environ.get('XDG_DATA_HOME') or os.path.expanduser(os.path.join('~', '.local', 'share')) +shared_data_dir = os.path.join(xdg_base_dir, 'agpt.co') + +# if the data directory doesn’t exist auto-gpt bails +os.makedirs(os.path.join(shared_data_dir, "data"), exist_ok=True) + +# change to this directory because auto-gpt assumes it is running +# in its own checkout and is not suitable to be run from anywhere +os.chdir(shared_data_dir) + +print(f"tea: OUTPUT WILL BE HERE: {shared_data_dir}") import autogpt.cli autogpt.cli.main()