fix: copilot-update.sh/.fish Syntax-Fehler (fi/end + Box-Drawing-Zeichen)

This commit is contained in:
Conrad Schulz 2026-06-03 09:59:18 +00:00
parent 931ae595b2
commit f066b06863
5 changed files with 63 additions and 3 deletions

View file

@ -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 | | `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` | | 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: 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/` |

View file

@ -318,3 +318,50 @@ Drei neue ⚠-Warnungen ergänzt:
⚠ Keine Platzhalter wie PENDING committen. Hash weglassen oder direkt nach Commit nachziehen. ⚠ 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
```

View file

@ -8,7 +8,7 @@
## Aktueller Projektstatus ## 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 **Phase:** Produktion / stabil wird bei Bedarf erweitert
--- ---

View file

@ -62,7 +62,9 @@ if test -f $SOURCE/scripts/copilot-update.fish
echo " ✓ copilot-update.fish selbst aktualisiert starte neue Version..." echo " ✓ copilot-update.fish selbst aktualisiert starte neue Version..."
exec fish $SELF $argv exec fish $SELF $argv
end end
end ──────────────────────────────────── end
# ── 2. ~/.git-templates/ aktualisieren ──────────────────────────────────────
set GIT_TEMPLATE_DIR $HOME/.git-templates set GIT_TEMPLATE_DIR $HOME/.git-templates
mkdir -p $GIT_TEMPLATE_DIR/.github $GIT_TEMPLATE_DIR/.vscode \ mkdir -p $GIT_TEMPLATE_DIR/.github $GIT_TEMPLATE_DIR/.vscode \
$GIT_TEMPLATE_DIR/hooks $GIT_TEMPLATE_DIR/docs \ $GIT_TEMPLATE_DIR/hooks $GIT_TEMPLATE_DIR/docs \

View file

@ -57,8 +57,11 @@ if [ -f "$SOURCE/scripts/copilot-update.sh" ]; then
echo " ✓ copilot-update.sh selbst aktualisiert starte neue Version..." echo " ✓ copilot-update.sh selbst aktualisiert starte neue Version..."
exec "$SELF" "$@" exec "$SELF" "$@"
fi fi
fi ──────────────────────────────────── fi
GIT_TEMPLATE_DIR="$HOME/.git-templates" GIT_TEMPLATE_DIR="$HOME/.git-templates"
# ── 2. ~/.git-templates/ aktualisieren ──────────────────────────────────────
mkdir -p "$GIT_TEMPLATE_DIR/.github" "$GIT_TEMPLATE_DIR/.vscode" \ mkdir -p "$GIT_TEMPLATE_DIR/.github" "$GIT_TEMPLATE_DIR/.vscode" \
"$GIT_TEMPLATE_DIR/hooks" "$GIT_TEMPLATE_DIR/docs" \ "$GIT_TEMPLATE_DIR/hooks" "$GIT_TEMPLATE_DIR/docs" \
"$GIT_TEMPLATE_DIR/history/summary" "$GIT_TEMPLATE_DIR/history/summary"