BARON-SSO 로그인 연동 오류 개선변수/비밀 키 등록 변경
This commit is contained in:
@@ -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 \
|
||||
|
||||
Reference in New Issue
Block a user