From dfcc07191551e5d92636d410ea670f7db3c3f6e3 Mon Sep 17 00:00:00 2001 From: Egor Yudkin Date: Fri, 13 Dec 2024 17:38:53 +0000 Subject: [PATCH] Export `VITE_` environment variables in `Start.sh` --- app/start.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/app/start.sh b/app/start.sh index 68fbec173c..8472206b40 100755 --- a/app/start.sh +++ b/app/start.sh @@ -1,9 +1,26 @@ #!/bin/sh -# cd into the parent directory of the script, +# cd into the parent directory of the script, # so that the script generates virtual environments always in the same path. cd "${0%/*}" || exit 1 +echo "" +echo "Loading azd .env file from current environment" +echo "" + +while IFS='=' read -r key value; do + value=$(echo "$value" | sed 's/^"//' | sed 's/"$//') + # Only export variables that start with "VITE_" + case "$key" in + VITE_*) + export "$key=$value" + echo "Exported $key" + ;; + esac +done <