From 27da0e5096c35005800cb1e04d378b6019bcc453 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Tue, 22 Oct 2024 17:13:36 -0700 Subject: [PATCH] Avoid overwriting env vars --- build.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.sh b/build.sh index 7e9ca269..837b2412 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +temp_env=$(env) + if [ -f .env ]; then source .env fi @@ -8,6 +10,10 @@ if [ -f .env.local ]; then source .env.local fi +# Avoid overwriting env vars provided directly +# https://stackoverflow.com/a/69127685/1467342 +eval "$temp_env" + if [[ $VITE_PLATFORM_LOGO =~ ^https://* ]]; then curl $VITE_PLATFORM_LOGO > static/logo.png export VITE_PLATFORM_LOGO=static/logo.png