From 2d6dde68cf98eebdd41aa8bb9d5e0aca301c3fab Mon Sep 17 00:00:00 2001 From: root Date: Mon, 27 Jul 2026 18:07:41 +0900 Subject: [PATCH] =?UTF-8?q?BARON-SSO=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EC=97=B0=EB=8F=99=20=EC=98=A4=EB=A5=98=20=EA=B0=9C=EC=84=A0?= =?UTF-8?q?=EB=B3=80=EC=88=98/=EB=B9=84=EB=B0=80=20=ED=82=A4=20=EB=93=B1?= =?UTF-8?q?=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/deploy_remote.sh | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/scripts/deploy_remote.sh b/scripts/deploy_remote.sh index 772386d..de2e258 100755 --- a/scripts/deploy_remote.sh +++ b/scripts/deploy_remote.sh @@ -31,11 +31,38 @@ if [[ -n "$env_file" ]]; then cp "$env_file" .env fi +load_env_file() { + local env_path="$1" + local line="" + local key="" + local value="" + + while IFS= read -r line || [[ -n "$line" ]]; do + line="${line%$'\r'}" + + if [[ -z "$line" || "$line" =~ ^[[:space:]]*# ]]; then + continue + fi + + key="${line%%=*}" + value="${line#*=}" + + key="$(printf '%s' "$key" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')" + + if [[ -z "$key" ]]; then + continue + fi + + if [[ "$value" =~ ^\'.*\'$ || "$value" =~ ^\".*\"$ ]]; then + value="${value:1:${#value}-2}" + fi + + export "$key=$value" + done < "$env_path" +} + if [[ -f .env ]]; then - set -a - # shellcheck disable=SC1091 - source .env - set +a + load_env_file .env fi mkdir -p \