From 6d3c414a80bb20339b3501f52be4a9856c30d96a Mon Sep 17 00:00:00 2001 From: turbra <52045281+turbra@users.noreply.github.com> Date: Fri, 8 Nov 2024 16:44:27 -0500 Subject: [PATCH] Update bindings.sh --- bindings.sh | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/bindings.sh b/bindings.sh index c8a86ead..a5bcc8c2 100755 --- a/bindings.sh +++ b/bindings.sh @@ -2,15 +2,31 @@ bindings="" -while IFS= read -r line || [ -n "$line" ]; do - if [[ ! "$line" =~ ^# ]] && [[ -n "$line" ]]; then - name=$(echo "$line" | cut -d '=' -f 1) - value=$(echo "$line" | cut -d '=' -f 2-) - value=$(echo $value | sed 's/^"\(.*\)"$/\1/') - bindings+="--binding ${name}=${value} " +# List all the environment variables you need +keys=( + "GROQ_API_KEY" + "OPENAI_API_KEY" + "ANTHROPIC_API_KEY" + "OPEN_ROUTER_API_KEY" + "GOOGLE_GENERATIVE_AI_API_KEY" + "OLLAMA_API_BASE_URL" + "OPENAI_LIKE_API_BASE_URL" + "DEEPSEEK_API_KEY" + "OPENAI_LIKE_API_KEY" + "MISTRAL_API_KEY" + "XAI_API_KEY" + "VITE_LOG_LEVEL" +) + +# Iterate over each key and retrieve its value from the environment +for key in "${keys[@]}"; do + value=$(printenv "$key") + if [[ -n "$value" ]]; then + bindings+="--binding ${key}=${value} " fi -done < .env.local +done +# Trim any trailing whitespace bindings=$(echo $bindings | sed 's/[[:space:]]*$//') echo $bindings