From 052cfcea4c0bc696f062fdab986113c39573d0cf Mon Sep 17 00:00:00 2001 From: Stephan D Date: Tue, 11 Nov 2025 13:09:33 +0100 Subject: [PATCH] chain gateway build fix --- ci/prod/scripts/deploy/billing_fees.sh | 11 +++++++++-- ci/prod/scripts/deploy/fx.sh | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ci/prod/scripts/deploy/billing_fees.sh b/ci/prod/scripts/deploy/billing_fees.sh index b9286ae..5f8fcc0 100644 --- a/ci/prod/scripts/deploy/billing_fees.sh +++ b/ci/prod/scripts/deploy/billing_fees.sh @@ -83,13 +83,20 @@ cd "${REMOTE_DIR}/compose" set -a . ../env/.env.runtime load_kv_file() { - file="$1" + local file="$1" while IFS= read -r line || [ -n "$line" ]; do case "$line" in ''|\#*) continue ;; esac if printf '%s' "$line" | grep -Eq '^[[:alpha:]_][[:alnum:]_]*='; then - eval "$line" + local key="${line%%=*}" + local value="${line#*=}" + key="$(printf '%s' "$key" | tr -d '[:space:]')" + value="${value#"${value%%[![:space:]]*}"}" + value="${value%"${value##*[![:space:]]}"}" + if [[ -n "$key" ]]; then + export "$key=$value" + fi fi done <"$file" } diff --git a/ci/prod/scripts/deploy/fx.sh b/ci/prod/scripts/deploy/fx.sh index bd90441..d7572c1 100644 --- a/ci/prod/scripts/deploy/fx.sh +++ b/ci/prod/scripts/deploy/fx.sh @@ -109,13 +109,20 @@ cd "${REMOTE_DIR}/compose" set -a . ../env/.env.runtime load_kv_file() { - file="$1" + local file="$1" while IFS= read -r line || [ -n "$line" ]; do case "$line" in ''|\#*) continue ;; esac if printf '%s' "$line" | grep -Eq '^[[:alpha:]_][[:alnum:]_]*='; then - eval "$line" + local key="${line%%=*}" + local value="${line#*=}" + key="$(printf '%s' "$key" | tr -d '[:space:]')" + value="${value#"${value%%[![:space:]]*}"}" + value="${value%"${value##*[![:space:]]}"}" + if [[ -n "$key" ]]; then + export "$key=$value" + fi fi done <"$file" }