diff --git a/deployment/env.template b/deployment/env.template index af5cd993..43fe5aa7 100644 --- a/deployment/env.template +++ b/deployment/env.template @@ -66,6 +66,7 @@ export AZURE_API_BASE="" export AZURE_API_KEY="" export OPENAI_API_KEY="" export ANTHROPIC_API_KEY="" +# export GEMINI_API_KEY="" # LangFuse settings, instructing LLM-applications to log their LLM traces # export LANGFUSE_ENABLED=true diff --git a/scripts/common.sh b/scripts/common.sh index dfe0b243..5d403f79 100755 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -385,7 +385,12 @@ configure_simple_api_key() { fi if [ -n "$value" ]; then - portable_sed "s|.*export $var_name=.*|export $var_name=\"$value\"|" deployment/env + # Check if the export line exists anywhere in the file; if not, append it, else update it + if grep -q "export $var_name=" deployment/env; then + portable_sed "s|.*export $var_name=.*|export $var_name=\"$value\"|" deployment/env + else + echo "export $var_name=\"$value\"" >> deployment/env + fi return 0 else # Clear the key if skipped (set to empty string)