fix: SIGPIPE (exit 141) in mise verification, remove redundant bat script
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>
This commit is contained in:
@@ -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"
|
|
||||||
@@ -22,7 +22,7 @@ if ! command -v chafa &> /dev/null; then
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
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)
|
# pdftotext — PDF text extraction (part of poppler)
|
||||||
if ! command -v pdftotext &> /dev/null; then
|
if ! command -v pdftotext &> /dev/null; then
|
||||||
@@ -41,6 +41,6 @@ if ! command -v pdftotext &> /dev/null; then
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
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"
|
log_pass "preview dependencies"
|
||||||
|
|||||||
@@ -101,15 +101,15 @@ log_info "Verifying installations..."
|
|||||||
echo "node $(mise exec -- node --version)"
|
echo "node $(mise exec -- node --version)"
|
||||||
echo "npm $(mise exec -- npm --version)"
|
echo "npm $(mise exec -- npm --version)"
|
||||||
mise exec -- gh --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 "firebase: $(mise exec -- firebase --version)"
|
||||||
echo "fastfetch: $(mise exec -- fastfetch --version 2>&1 | head -1)"
|
echo "fastfetch: $(mise exec -- fastfetch --version 2>&1 | sed -n '1p')"
|
||||||
mise exec -- glow --version | head -1
|
mise exec -- glow --version | sed -n '1p'
|
||||||
fi
|
fi
|
||||||
echo "fzf $(fzf --version)"
|
echo "fzf $(fzf --version)"
|
||||||
bat --version | head -1
|
bat --version | sed -n '1p'
|
||||||
zoxide --version
|
zoxide --version
|
||||||
rg --version | head -1
|
rg --version | sed -n '1p'
|
||||||
delta --version 2>/dev/null | head -1 || echo "delta: installed (version check failed)"
|
delta --version 2>/dev/null | sed -n '1p' || echo "delta: installed (version check failed)"
|
||||||
} | log_quote
|
} | log_quote
|
||||||
log_pass "mise tools installed"
|
log_pass "mise tools installed"
|
||||||
|
|||||||
@@ -24,5 +24,5 @@ if ! command -v cmatrix &> /dev/null; then
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
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"
|
log_pass "cmatrix installed"
|
||||||
|
|||||||
Reference in New Issue
Block a user