From 296ad6c4eb23258730489728783d856dce28a74a Mon Sep 17 00:00:00 2001 From: Andrejus Date: Wed, 18 Mar 2026 18:53:19 +0000 Subject: [PATCH] fix: SIGPIPE (exit 141) in mise verification, remove redundant bat script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace head -1 with sed -n '1p' across all install scripts to prevent SIGPIPE when commands produce multi-line output. head closes the pipe after reading line 1, causing the writer to receive SIGPIPE which propagates via pipefail (exit 141). sed reads all input, avoiding the broken pipe. Remove install.d/26-bat.sh — bat is already installed and managed via mise in 30-mise.sh. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- install.d/26-bat.sh | 33 --------------------------------- install.d/27-preview.sh | 4 ++-- install.d/30-mise.sh | 12 ++++++------ install.d/81-cmatrix.sh | 2 +- 4 files changed, 9 insertions(+), 42 deletions(-) delete mode 100644 install.d/26-bat.sh diff --git a/install.d/26-bat.sh b/install.d/26-bat.sh deleted file mode 100644 index 756b84e..0000000 --- a/install.d/26-bat.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -# ----------------------------------------------------------------------------- -# Description: -# Install bat and build theme cache from dotfiles. -# - -if ! command -v bat &> /dev/null; then - case "$DOTS_PKG" in - brew) - brew install bat - ;; - apt) - sudo apt-get install -qq bat - # Debian installs binary as 'batcat'; symlink to 'bat' - if ! command -v bat &> /dev/null && command -v batcat &> /dev/null; then - sudo ln -sf "$(which batcat)" /usr/local/bin/bat - fi - ;; - pacman) - sudo pacman -S --noconfirm bat - ;; - *) - log_warn "Skipping bat install: no supported package manager found" - return 0 - ;; - esac -fi - -bat --version | log_quote - -bat cache --build &>/dev/null -log_pass "bat theme cache built" diff --git a/install.d/27-preview.sh b/install.d/27-preview.sh index 0a4e52c..8123328 100755 --- a/install.d/27-preview.sh +++ b/install.d/27-preview.sh @@ -22,7 +22,7 @@ if ! command -v chafa &> /dev/null; then ;; esac fi -command -v chafa &> /dev/null && chafa --version | head -1 | log_quote +command -v chafa &> /dev/null && chafa --version | sed -n '1p' | log_quote # pdftotext — PDF text extraction (part of poppler) if ! command -v pdftotext &> /dev/null; then @@ -41,6 +41,6 @@ if ! command -v pdftotext &> /dev/null; then ;; esac fi -command -v pdftotext &> /dev/null && pdftotext -v 2>&1 | head -1 | log_quote +command -v pdftotext &> /dev/null && pdftotext -v 2>&1 | sed -n '1p' | log_quote log_pass "preview dependencies" diff --git a/install.d/30-mise.sh b/install.d/30-mise.sh index 50556c6..ec54ad5 100755 --- a/install.d/30-mise.sh +++ b/install.d/30-mise.sh @@ -101,15 +101,15 @@ log_info "Verifying installations..." echo "node $(mise exec -- node --version)" echo "npm $(mise exec -- npm --version)" mise exec -- gh --version - mise exec -- terraform --version | head -1 + mise exec -- terraform --version | sed -n '1p' echo "firebase: $(mise exec -- firebase --version)" - echo "fastfetch: $(mise exec -- fastfetch --version 2>&1 | head -1)" - mise exec -- glow --version | head -1 + echo "fastfetch: $(mise exec -- fastfetch --version 2>&1 | sed -n '1p')" + mise exec -- glow --version | sed -n '1p' fi echo "fzf $(fzf --version)" - bat --version | head -1 + bat --version | sed -n '1p' zoxide --version - rg --version | head -1 - delta --version 2>/dev/null | head -1 || echo "delta: installed (version check failed)" + rg --version | sed -n '1p' + delta --version 2>/dev/null | sed -n '1p' || echo "delta: installed (version check failed)" } | log_quote log_pass "mise tools installed" diff --git a/install.d/81-cmatrix.sh b/install.d/81-cmatrix.sh index 32e98ff..61678e3 100755 --- a/install.d/81-cmatrix.sh +++ b/install.d/81-cmatrix.sh @@ -24,5 +24,5 @@ if ! command -v cmatrix &> /dev/null; then ;; esac fi -command -v cmatrix &> /dev/null && cmatrix -V 2>&1 | head -1 | log_quote +command -v cmatrix &> /dev/null && cmatrix -V 2>&1 | sed -n '1p' | log_quote log_pass "cmatrix installed"