From 7280d08c48218ee332f50741cf8d75b01f5af008 Mon Sep 17 00:00:00 2001 From: Jacob Heider Date: Tue, 10 Oct 2023 14:47:05 -0400 Subject: [PATCH] fix(gpt-engineer) closes #3606 --- .../github.com/AntonOsika/gpt-engineer/entrypoint.sh | 9 ++++++--- projects/github.com/AntonOsika/gpt-engineer/package.yml | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/projects/github.com/AntonOsika/gpt-engineer/entrypoint.sh b/projects/github.com/AntonOsika/gpt-engineer/entrypoint.sh index b4b03b2d..bfec2b13 100644 --- a/projects/github.com/AntonOsika/gpt-engineer/entrypoint.sh +++ b/projects/github.com/AntonOsika/gpt-engineer/entrypoint.sh @@ -1,4 +1,5 @@ #!/usr/bin/env -S tea bash +# shellcheck shell=bash #--- # dependencies: @@ -8,11 +9,12 @@ set -eo pipefail # attempt to get the key from the user’s shell rc files (if set) -if [ -z "$OPENAI_API_KEY" -a -n "$SHELL" ]; then +if [ -z "$OPENAI_API_KEY" ] && [ -n "$SHELL" ]; then + # shellcheck disable=SC2155,2016 export OPENAI_API_KEY="$(env -i "$SHELL" -ic 'echo $OPENAI_API_KEY')" fi -if [ -z "$OPENAI_API_KEY"]; then +if [ -z "$OPENAI_API_KEY" ]; then gum format <