From f066b06863b35380edda3a225d0603ddb47e14e6 Mon Sep 17 00:00:00 2001 From: Conrad Schulz Date: Wed, 3 Jun 2026 09:59:18 +0000 Subject: [PATCH] fix: copilot-update.sh/.fish Syntax-Fehler (fi/end + Box-Drawing-Zeichen) --- docs/MAINTAINER.md | 8 ++++ ...e-commit-check6-session-pflicht_session.md | 47 +++++++++++++++++++ history/summary/PROJECT_CONTEXT.md | 2 +- scripts/copilot-update.fish | 4 +- scripts/copilot-update.sh | 5 +- 5 files changed, 63 insertions(+), 3 deletions(-) diff --git a/docs/MAINTAINER.md b/docs/MAINTAINER.md index 5f0d715..fd9df4d 100644 --- a/docs/MAINTAINER.md +++ b/docs/MAINTAINER.md @@ -127,3 +127,11 @@ Dateien unter `git-templates/` bearbeiten → `deploy.sh` ausführen → neue Re | `history/prompts/` committed | Vollständige Agent-History bleibt im Repo erhalten; ermöglicht lückenlose Nachvollziehbarkeit | | pre-commit Hook als Quality Gate (6 Checks) | Automatisches Netz: Tests, Doku, 3-Zielgruppen, PROJECT_CONTEXT, Requirements, Session-Datei; Opt-outs via `.copilot-no-tests` / `.copilot-no-docs` / `.copilot-no-requirements` | | Check 6: Session-Datei muss in jedem Commit gestaged sein | Jeder Commit ist mit Agent-Session verknüpft; kein Opt-out; erzwingt `/history` vor `git commit` | +| Check 6 prüft Datum + `### Prompt`-Inhalt | Verhindert reine Nachtrag-Blöcke ohne echte Prompt-Einträge; Session-Datei muss heutiges Datum im Namen tragen | + +## Bekannte Fallstricke + +| Problem | Ursache | Fix | +|---|---|---| +| `Syntax error: word unexpected` in `copilot-update.sh` Zeile ~60 | Box-Drawing-Zeichen (`────`) direkt ans `fi` angehängt statt auf eigener Zeile | `fi` allein auf Zeile, Kommentar-Linie separat (`# ──`) | +| Self-Update überschreibt manuell deployten Fix | Self-Update holt Version aus Remote-Cache, der noch kaputten Stand hat | Erst committen + pushen, dann manuell deployen: `cp scripts/copilot-update.sh ~/.local/bin/` | diff --git a/history/prompts/2026-06-03_pre-commit-check6-session-pflicht_session.md b/history/prompts/2026-06-03_pre-commit-check6-session-pflicht_session.md index c328ce1..8dd94f6 100644 --- a/history/prompts/2026-06-03_pre-commit-check6-session-pflicht_session.md +++ b/history/prompts/2026-06-03_pre-commit-check6-session-pflicht_session.md @@ -318,3 +318,50 @@ Drei neue ⚠-Warnungen ergänzt: ⚠ Keine Platzhalter wie PENDING committen. Hash weglassen oder direkt nach Commit nachziehen. ``` +### Prompt 16 +„git copilot-update +=== Copilot Update === + → Pulling latest from setup repo... + ✓ Cache aktualisiert: /home/rd13server/.copilot-setup +/home/rd13server/.local/bin/copilot-update.sh: 60: Syntax error: word unexpected" + +### Antwort 16 +Ursache: Box-Drawing-Zeichen direkt ans `fi` / `end` angehängt statt auf eigener Kommentarzeile. +In `copilot-update.sh` Zeile 60: `fi ────────────────` → Syntax-Fehler in POSIX sh. +In `copilot-update.fish` Zeile 65: `end ────────────────` → gleicher Fehler. + +Der Self-Update-Mechanismus hat den Fix jedes Mal überschrieben, weil er vor dem Commit+Push ausgeführt wurde und die kaputte Version aus dem Remote-Cache holte. + +Fix in `scripts/copilot-update.sh`: +```sh +# vorher: +fi ──────────────────────────────────── +GIT_TEMPLATE_DIR="$HOME/.git-templates" + +# nachher: +fi + +GIT_TEMPLATE_DIR="$HOME/.git-templates" + +# ── 2. ~/.git-templates/ aktualisieren ────────────────────────────────────── +``` + +Fix in `scripts/copilot-update.fish`: +```fish +# vorher: +end ──────────────────────────────────── +set GIT_TEMPLATE_DIR $HOME/.git-templates + +# nachher: +end + +# ── 2. ~/.git-templates/ aktualisieren ────────────────────────────────────── +set GIT_TEMPLATE_DIR $HOME/.git-templates +``` + +Syntax-Check: +``` +sh -n scripts/copilot-update.sh → sh: OK +fish -n scripts/copilot-update.fish → fish: OK +``` + diff --git a/history/summary/PROJECT_CONTEXT.md b/history/summary/PROJECT_CONTEXT.md index 53bf440..95a356a 100644 --- a/history/summary/PROJECT_CONTEXT.md +++ b/history/summary/PROJECT_CONTEXT.md @@ -8,7 +8,7 @@ ## Aktueller Projektstatus -**Letzte Aktualisierung:** 2026-06-03 – copilot-instructions: Antwort-Format präzisiert (exakte Kommandos + kein PENDING) +**Letzte Aktualisierung:** 2026-06-03 – copilot-update.sh/.fish Syntax-Fix (fi/end + Box-Drawing-Zeichen) **Phase:** Produktion / stabil – wird bei Bedarf erweitert --- diff --git a/scripts/copilot-update.fish b/scripts/copilot-update.fish index 7653e05..04336fa 100644 --- a/scripts/copilot-update.fish +++ b/scripts/copilot-update.fish @@ -62,7 +62,9 @@ if test -f $SOURCE/scripts/copilot-update.fish echo " ✓ copilot-update.fish selbst aktualisiert – starte neue Version..." exec fish $SELF $argv end -end ──────────────────────────────────── +end + +# ── 2. ~/.git-templates/ aktualisieren ────────────────────────────────────── set GIT_TEMPLATE_DIR $HOME/.git-templates mkdir -p $GIT_TEMPLATE_DIR/.github $GIT_TEMPLATE_DIR/.vscode \ $GIT_TEMPLATE_DIR/hooks $GIT_TEMPLATE_DIR/docs \ diff --git a/scripts/copilot-update.sh b/scripts/copilot-update.sh index 111da40..9b17e66 100644 --- a/scripts/copilot-update.sh +++ b/scripts/copilot-update.sh @@ -57,8 +57,11 @@ if [ -f "$SOURCE/scripts/copilot-update.sh" ]; then echo " ✓ copilot-update.sh selbst aktualisiert – starte neue Version..." exec "$SELF" "$@" fi -fi ──────────────────────────────────── +fi + GIT_TEMPLATE_DIR="$HOME/.git-templates" + +# ── 2. ~/.git-templates/ aktualisieren ────────────────────────────────────── mkdir -p "$GIT_TEMPLATE_DIR/.github" "$GIT_TEMPLATE_DIR/.vscode" \ "$GIT_TEMPLATE_DIR/hooks" "$GIT_TEMPLATE_DIR/docs" \ "$GIT_TEMPLATE_DIR/history/summary"