build.sh: fix empty array expansion under set -u

${arr[@]} with set -u throws 'unbound variable' when the array is empty.
Use ${arr[@]+"${arr[@]}"} which only expands if the array is set.

https://claude.ai/code/session_01FKCW3FDjNFj6jve4niMFXH
This commit is contained in:
Claude 2026-03-19 09:58:20 +00:00
parent efca2b5941
commit 54ddc0d856
No known key found for this signature in database

View file

@ -99,7 +99,7 @@ fi
docker run --detach \ docker run --detach \
--name "$CONTAINER_NAME" \ --name "$CONTAINER_NAME" \
--network hiy-net \ --network hiy-net \
"${ENV_FILE_ARG[@]}" \ "${ENV_FILE_ARG[@]+"${ENV_FILE_ARG[@]}"}" \
--expose "$PORT" \ --expose "$PORT" \
--label "hiy.app=${APP_ID}" \ --label "hiy.app=${APP_ID}" \
--label "hiy.port=${PORT}" \ --label "hiy.port=${PORT}" \