From 3ea82609518e400749fbb348db1f12bf736709a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Fri, 28 Jul 2023 05:53:21 -0700 Subject: [PATCH] Fix .env.test parser --- server/scripts/setenv.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/scripts/setenv.sh b/server/scripts/setenv.sh index 29d74b2f4fd1..92b8dc9b5d3e 100755 --- a/server/scripts/setenv.sh +++ b/server/scripts/setenv.sh @@ -11,7 +11,13 @@ ENV_PATH="${SCRIPT_DIR}/../.env.test" if [ -f "${ENV_PATH}" ]; then echo "🔵 - Loading environment variables from "${ENV_PATH}"..." # Export env vars - export $(grep -v '^#' ${ENV_PATH} | xargs) + while read -r line || [ -n "$line" ]; do + if echo "$line" | grep -F = &>/dev/null + then + varname=$(echo "$line" | cut -d '=' -f 1) + export "$varname" + fi + done < <(grep -v '^#' "${ENV_PATH}") else echo "Error: ${ENV_PATH} does not exist." exit 1