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" }