From 74c6b5a1856186689e572c83e30831dc36dd8796 Mon Sep 17 00:00:00 2001 From: klaas Date: Wed, 26 Mar 2025 23:16:04 +0100 Subject: [PATCH] install.sh aktualisiert --- install.sh | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 6257337..cb9b666 100644 --- a/install.sh +++ b/install.sh @@ -29,7 +29,25 @@ run() { if [ "$DEBUG" = true ]; then "$@" else - "$@" >> "$LOGFILE" 2>&1 + local CMD="$*" + local TMP_LOG=$(mktemp) + + if "$@" >"$TMP_LOG" 2>&1; then + # Nur relevante Einzelzeilen loggen (optional) + echo "[OK] $CMD" >> "$LOGFILE" + else + # Fehlerfall: logge alles + { + echo "❌ Fehler bei Befehl: $CMD" + echo "------- BEGIN AUSGABE -------" + cat "$TMP_LOG" + echo "-------- END AUSGABE --------" + echo + } >> "$LOGFILE" + log "❌ Fehler bei: $CMD (Details siehe $LOGFILE)" + fi + + rm -f "$TMP_LOG" fi } @@ -66,17 +84,17 @@ if ! sudo apt install -y nala; then if ! sudo apt install -y nala; then log "❌ nala konnte auch nach Hinzufügen der Quelle nicht installiert werden. Updates müssen später manuell installiert werden" log "📦 Installiere Pakete..." - run sudo apt install alacritty ninja-build gettext libtool-bin cmake g++ pkg-config unzip curl git tmux build-essential manpages-dev clangd python3-jedi zsh -y + run sudo apt install vim alacritty ninja-build gettext libtool-bin cmake g++ pkg-config unzip curl git tmux build-essential manpages-dev clangd python3-jedi zsh -y else apt_safe_upgrade log "📦 Installiere Pakete..." - run sudo nala install alacritty ninja-build gettext libtool-bin cmake g++ pkg-config unzip curl git tmux build-essential manpages-dev clangd python3-jedi zsh -y + run sudo nala install vim alacritty ninja-build gettext libtool-bin cmake g++ pkg-config unzip curl git tmux build-essential manpages-dev clangd python3-jedi zsh -y fi else log "✅ nala erfolgreich installiert." apt_safe_upgrade log "📦 Installiere Pakete..." - run sudo nala install alacritty ninja-build gettext libtool-bin cmake g++ pkg-config unzip curl git tmux build-essential manpages-dev clangd python3-jedi zsh -y + run sudo nala install vim alacritty ninja-build gettext libtool-bin cmake g++ pkg-config unzip curl git tmux build-essential manpages-dev clangd python3-jedi zsh -y fi pause_if_debug