perf: install env checks

This commit is contained in:
2025-12-23 20:53:55 +02:00
parent a286817ce3
commit 891ae505f8
30 changed files with 492 additions and 490 deletions

View File

@@ -5,27 +5,23 @@
# Install cmatrix.
#
# skip if in CODESPACES
if [[ -n "$CODESPACES" ]]; then
log_warn "Running in GitHub Codespaces"
export SKIP_CMATRIX_CONFIG=1
fi
# skip if in Codespaces
[[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; return 0; }
if [[ -z "$SKIP_CMATRIX_CONFIG" ]]; then
if ! command -v cmatrix &> /dev/null; then
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
if command -v apt-get >/dev/null 2>&1; then
sudo apt-get install -qq cmatrix &>/dev/null
elif command -v pacman >/dev/null 2>&1; then
sudo pacman -S --noconfirm cmatrix &>/dev/null
else
log_warn "Skipping cmatrix install: no supported package manager found"
fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
if ! command -v cmatrix &> /dev/null; then
case "$DOTS_PKG" in
apt)
sudo apt-get install -qq cmatrix &>/dev/null
;;
pacman)
sudo pacman -S --noconfirm cmatrix &>/dev/null
;;
brew)
brew install cmatrix
fi
fi
log_pass "cmatrix installed successfully!"
else
log_warn "Skipping cmatrix configuration"
;;
*)
log_warn "Skipping cmatrix install: no supported package manager found"
;;
esac
fi
log_pass "cmatrix installed successfully!"