From 35fc4ca2e6de281f8c0829a9daaa9269240e58a2 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 13 Nov 2026 01:37:59 +0000 Subject: [PATCH] =?UTF-8?q?[170]=20Linux=20Test-Rechner:=20update-dossier?= =?UTF-8?q?=20--tester=20baut=20ein=20AppImage=20und=20l=C3=B6scht=20danac?= =?UTF-8?q?h=20node=5Fmodules,=20dist=20und=20npm-/Cargo-/Browser-Caches;?= =?UTF-8?q?=20dossier=20startet=20dann=20das=20AppImage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/install-linux-commands.sh | 14 +++++++++++--- scripts/update-linux.sh | 25 ++++++++++++++++++++++--- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/scripts/install-linux-commands.sh b/scripts/install-linux-commands.sh index 04e28ad8..edc67159 100755 --- a/scripts/install-linux-commands.sh +++ b/scripts/install-linux-commands.sh @@ -2,7 +2,9 @@ # install-linux-commands.sh — legt die Befehle `dossier` (App starten) und `update-dossier` (neusten Stand holen, # bauen, aufräumen) in ~/.local/bin an. Unabhängig von der Shell (bash, zsh, fish). Einmal ausführen: # -# ./scripts/install-linux-commands.sh +# ./scripts/install-linux-commands.sh Entwicklung: `dossier` startet aus dem Quellcode (npm run electron) +# ./scripts/install-linux-commands.sh --tester Test-Rechner: `update-dossier` baut ein AppImage und löscht danach +# alles zum Bauen Nötige; `dossier` startet das AppImage # # Danach überall: `dossier` startet Dossier, `update-dossier` aktualisiert (Optionen wie scripts/update-linux.sh, # z. B. `update-dossier --start`). Entfernen: rm ~/.local/bin/dossier ~/.local/bin/update-dossier @@ -10,19 +12,25 @@ set -euo pipefail repo="$(cd "$(dirname "$0")/.." && pwd)" +mode="" +[ "${1:-}" = "--tester" ] && mode="--tester" bin="${XDG_BIN_HOME:-$HOME/.local/bin}" mkdir -p "$bin" cat >"$bin/dossier" </dev/null | head -1) +if [ ! -d node_modules ] && [ -n "\$app" ]; then exec "\$app" "\$@"; fi +exec npm run electron -- "\$@" EOF cat >"$bin/update-dossier" <&2; exit 2 ;; esac shift @@ -95,10 +100,24 @@ if [ "$KEEP_BUILD" = 0 ]; then fi rm -rf "${CARGO_HOME:-$HOME/.cargo}/registry/cache" "${CARGO_HOME:-$HOME/.cargo}/git/checkouts" dist-test test-results echo "Cargo-Download-Cache, dist-test/ und test-results/ gelöscht." -du -sh node_modules src/engine 2>/dev/null | sed 's/^/ bleibt: /' +if [ "$TESTER" = 1 ]; then + # Nur zum Bauen nötig — das AppImage enthält alles, was die App braucht. + rm -rf node_modules dist release/*-unpacked release/builder-*.yml release/latest*.yml + npm cache clean --force >/dev/null 2>&1 || true + rm -rf "${CARGO_HOME:-$HOME/.cargo}/registry/src" "${CARGO_HOME:-$HOME/.cargo}/registry/index" + rm -rf "$HOME/.cache/puppeteer" "$HOME/.cache/ms-playwright" "$HOME/.cache/electron-builder" + echo "Test-Rechner: node_modules, dist, npm-/Cargo-/Browser-Caches gelöscht (beim nächsten Update wieder geladen)." + du -sh release/*.AppImage 2>/dev/null | sed 's/^/ bleibt: /' +else + du -sh node_modules src/engine 2>/dev/null | sed 's/^/ bleibt: /' +fi say "Fertig: $(git log -1 --format='%h %s')" -if [ "$START" = 1 ]; then +if [ "$TESTER" = 1 ]; then + app=$(ls -1t release/Dossier-*.AppImage 2>/dev/null | head -1) + [ "$START" = 1 ] && exec "$app" + echo "Starten mit: $app (oder: dossier)" +elif [ "$START" = 1 ]; then exec npm run electron else echo "Starten mit: npm run electron"