master #14

Merged
kdletters merged 226 commits from master into release 2026-05-13 13:23:09 +08:00
Showing only changes of commit d5d3fa1641 - Show all commits

View File

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