ci: fix server provision shell quoting
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
2026-05-07 14:57:51 +08:00
parent 0816d2e326
commit d5d3fa1641

View File

@@ -287,7 +287,8 @@ BASH
read_env_value() {
local file="$1"
local key="$2"
local line value
local line value quote_char
quote_char='"'
if [[ ! -f "${file}" ]]; then
return
@@ -296,10 +297,9 @@ BASH
while IFS= read -r line || [[ -n "${line}" ]]; do
if [[ "${line}" == "${key}="* ]]; then
value="${line#*=}"
value="$(printf "%s" "${value}" | tr -d "\\r")"
if [[ "${value}" == \"* && "${value}" == *\" ]]; then
value="${value#\"}"
value="${value%\"}"
value="$(printf "%s" "${value}" | tr -d "\r")"
if [[ ${#value} -ge 2 && "${value:0:1}" == "${quote_char}" && "${value: -1}" == "${quote_char}" ]]; then
value="${value:1:${#value}-2}"
fi
printf "%s" "${value}"
return