Deploy: up died on QuTS hero's older bash

`compose "${profile[@]}" up -d "${build[@]}"` aborts with "profile[@]:
unbound variable" on bash 4.3 and older, which treats expanding an EMPTY
array under `set -u` as unbound. DSM ships a newer bash, so this only
surfaced on QNAP. The ${arr[@]+"${arr[@]}"} form expands to nothing when
empty and is identical otherwise.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018SqJYt7jD7oUEkoY68sBZo
This commit is contained in:
2026-09-16 21:06:17 +02:00
co-authored by Claude Opus 5
parent 64ef3893d3
commit 348daf8ad7
+5 -1
View File
@@ -363,8 +363,12 @@ cmd_up() {
then re-run this command."
fi
detect_compose
# ${arr[@]+"${arr[@]}"} rather than plain "${arr[@]}": under `set -u`, bash
# 4.3 and older — which is what QuTS hero ships — treats expanding an EMPTY
# array as an unbound variable and aborts. The +-form expands to nothing at
# all when the array is empty, and is identical otherwise.
# shellcheck disable=SC2086
compose "${profile[@]}" up -d "${build[@]}" $COMPOSE_WAIT
compose ${profile[@]+"${profile[@]}"} up -d ${build[@]+"${build[@]}"} $COMPOSE_WAIT
health_gate || die "services did not come up healthy — check: ./deploy/webmail.sh logs"
record_version "${IMAGE_TAG:-local}"
grn "up. open http://<this-host>:${WEB_PORT:-8088}/"