[170] Linux Test-Rechner: update-dossier --tester baut ein AppImage und löscht danach node_modules, dist und npm-/Cargo-/Browser-Caches; dossier startet dann das AppImage
This commit is contained in:
2 files changed
+33
-6
No files matched your search
@@ -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" <<EOF
|
||||
#!/usr/bin/env bash
|
||||
# Startet Dossier aus $repo (angelegt von scripts/install-linux-commands.sh).
|
||||
cd "$repo" && exec npm run electron -- "\$@"
|
||||
cd "$repo"
|
||||
# Ohne node_modules (Test-Rechner, update-dossier --tester) das zuletzt gebaute AppImage, sonst aus dem Quellcode.
|
||||
app=\$(ls -1t release/Dossier-*.AppImage 2>/dev/null | head -1)
|
||||
if [ ! -d node_modules ] && [ -n "\$app" ]; then exec "\$app" "\$@"; fi
|
||||
exec npm run electron -- "\$@"
|
||||
EOF
|
||||
|
||||
cat >"$bin/update-dossier" <<EOF
|
||||
#!/usr/bin/env bash
|
||||
# Aktualisiert Dossier in $repo (angelegt von scripts/install-linux-commands.sh).
|
||||
exec "$repo/scripts/update-linux.sh" "\$@"
|
||||
exec "$repo/scripts/update-linux.sh" $mode "\$@"
|
||||
EOF
|
||||
|
||||
chmod +x "$bin/dossier" "$bin/update-dossier"
|
||||
|
||||
Reference in new issue
Block a user