fix Auto-GPT bailing due to no prompt file

This commit is contained in:
Max Howell 2023-07-31 11:17:36 -04:00
parent c2122cd4d0
commit 85d96cd0da
No known key found for this signature in database
GPG key ID: 741BB84EF5BB9EEC
3 changed files with 12 additions and 5 deletions

View file

@ -1,5 +1,7 @@
#!/bin/sh
#FIXME a `git init` type system would be better than a single directory :/
set -e
workspace_directory="${XDG_DOCUMENTS_DIR:-$HOME/Documents}/Auto-GPT"
@ -7,6 +9,10 @@ workspace_directory="${XDG_DOCUMENTS_DIR:-$HOME/Documents}/Auto-GPT"
# if the data|plugins directories dont exist auto-gpt bails
mkdir -p "$workspace_directory"/data "$workspace_directory"/plugins
if ! test -f "$workspace_directory/prompt_settings.yaml"; then
cp "$VIRTUAL_ENV"/../share/prompt_settings.yaml "$workspace_directory"
fi
# change to this directory because auto-gpt assumes it is running
# in its own checkout and is not suitable to be run from anywhere
cd "$workspace_directory"

View file

@ -41,7 +41,7 @@ EoMD
echo #spacer
GPT="$(gum choose {GPT3,GPT4})"
GPT="$(gum choose {GPT4,GPT3})"
docs="${XDG_DOCUMENTS_DIR:-$HOME/Documents}/Auto-GPT"
@ -52,7 +52,7 @@ gum format <<EoMD
# exe
running **Auto-GPT**…
running **Auto-GPT**… (*this might take a few minutes*)
EoMD
if test "$GPT" = GPT3

View file

@ -34,9 +34,10 @@ build:
# still pretty new and thus provides no executable, so we made one
- cp props/auto-gpt {{prefix}}/venv/bin
- |
mkdir {{prefix}}/share
cp .env.template {{prefix}}/share/env.template
- working-directory: "{{prefix}}/share"
run: |
cp $SRCROOT/.env.template env.template
cp $SRCROOT/prompt_settings.yaml .
- cp props/entrypoint.sh {{prefix}}