From 75c296669c8c67c296bc727e27ed4a21ddde4270 Mon Sep 17 00:00:00 2001 From: pi-farm Date: Fri, 13 Feb 2026 02:18:20 +0100 Subject: [PATCH] fix docker-compose.yml generation --- .gitea/workflows/build-and-push.yaml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/build-and-push.yaml b/.gitea/workflows/build-and-push.yaml index 983845f..886d521 100644 --- a/.gitea/workflows/build-and-push.yaml +++ b/.gitea/workflows/build-and-push.yaml @@ -327,15 +327,21 @@ jobs: line="${line//__HISTORY_CONTENT__/$HISTORY_CONTENT}" line="${line//__DOCKER_RUN__/$DOCKER_RUN_FINAL}" - # 2. Block Injection (Das fehlte!) + # 2. Block Injection (Jetzt sicher gegen Abstürze bei leeren Variablen) if [[ "$line" == *"__ENV_BLOCK__"* ]]; then - [ -n "$ENV_BLOCK_CONTENT" ] && echo -e "${ENV_BLOCK_CONTENT}" >> "$output" + if [ -n "$ENV_BLOCK_CONTENT" ]; then + echo -e "${ENV_BLOCK_CONTENT}" >> "$output" + fi elif [[ "$line" == *"__PORTS_BLOCK__"* ]]; then - [ -n "$PORTS_BLOCK_CONTENT" ] && echo -e "${PORTS_BLOCK_CONTENT}" >> "$output" + if [ -n "$PORTS_BLOCK_CONTENT" ]; then + echo -e "${PORTS_BLOCK_CONTENT}" >> "$output" + fi elif [[ "$line" == *"__VOL_BLOCK__"* ]]; then - [ -n "$VOL_BLOCK_CONTENT" ] && echo -e "${VOL_BLOCK_CONTENT}" >> "$output" + if [ -n "$VOL_BLOCK_CONTENT" ]; then + echo -e "${VOL_BLOCK_CONTENT}" >> "$output" + fi else - # Wenn kein Block-Platzhalter, schreibe die normale (ersetzte) Zeile + # Wenn kein Block-Platzhalter, schreibe die normale Zeile echo "$line" >> "$output" fi done < "$template"