mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-08 21:09:23 +08:00
Fix docker-setup.sh crash with optional env vars under set -u
This commit is contained in:
committed by
Peter Steinberger
parent
9c8967ef5d
commit
3c81ac0315
@@ -132,7 +132,7 @@ upsert_env() {
|
||||
local replaced=false
|
||||
for k in "${keys[@]}"; do
|
||||
if [[ "$key" == "$k" ]]; then
|
||||
printf '%s=%s\n' "$k" "${!k}" >>"$tmp"
|
||||
printf '%s=%s\n' "$k" "${!k-}" >>"$tmp"
|
||||
seen["$k"]=1
|
||||
replaced=true
|
||||
break
|
||||
@@ -146,7 +146,7 @@ upsert_env() {
|
||||
|
||||
for k in "${keys[@]}"; do
|
||||
if [[ -z "${seen[$k]:-}" ]]; then
|
||||
printf '%s=%s\n' "$k" "${!k}" >>"$tmp"
|
||||
printf '%s=%s\n' "$k" "${!k-}" >>"$tmp"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user