mirror of
https://github.com/okxlin/appstore.git
synced 2026-11-02 00:05:17 +00:00
fix(simon): preserve bcrypt form value on upgrade
This commit is contained in:
@@ -9,10 +9,8 @@ fail() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
read_env_value() {
|
||||
local key="$1"
|
||||
local value=""
|
||||
value="$(sed -n "s/^${key}=//p" "$ENV_FILE" | tail -n 1)"
|
||||
unquote_value() {
|
||||
local value="$1"
|
||||
case "$value" in
|
||||
\"*\") value="${value#\"}"; value="${value%\"}" ;;
|
||||
\'*\') value="${value#\'}"; value="${value%\'}" ;;
|
||||
@@ -20,10 +18,21 @@ read_env_value() {
|
||||
printf '%s\n' "$value"
|
||||
}
|
||||
|
||||
read_env_value() {
|
||||
local key="$1"
|
||||
local value=""
|
||||
value="$(sed -n "s/^${key}=//p" "$ENV_FILE" | tail -n 1)"
|
||||
unquote_value "$value"
|
||||
}
|
||||
|
||||
effective_value() {
|
||||
local key="$1"
|
||||
local value=""
|
||||
if [[ -v "$key" ]]; then
|
||||
printf '%s\n' "${!key}"
|
||||
value="${!key}"
|
||||
fi
|
||||
if [[ -n "$value" ]]; then
|
||||
unquote_value "$value"
|
||||
else
|
||||
read_env_value "$key"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user