feat(install): new apps, parallel brew cache, output formatting
Some checks failed
Dotfiles CI / Run test suite (Dockerfile) (push) Has been cancelled
Dotfiles CI / Run test suite (Dockerfile.arch) (push) Has been cancelled

Add eza, fd, sd, bottom, procs, tealdeer to mise apps. Add || true
guards to mise install/use and bat cache to prevent failures from
halting the installer.

Parallelize brew list --cask/--versions queries with background jobs.
Add log_indent helper. Cleaner script section formatting with ruled
separators and compact timing output.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-03-27 16:22:06 +00:00
parent 789ef71771
commit 3cdd079e2e
2 changed files with 32 additions and 12 deletions

View File

@@ -48,8 +48,8 @@ if [[ "$DOTS_ENV" != "codespaces" ]]; then
) )
log_info "Installing runtimes..." log_info "Installing runtimes..."
MISE_QUIET=1 mise install "${MISE_RUNTIMES[@]}" 2>&1 | log_quote MISE_QUIET=1 mise install "${MISE_RUNTIMES[@]}" 2>&1 | log_quote || true
MISE_QUIET=1 mise use -g "${MISE_RUNTIMES[@]}" 2>&1 | log_quote MISE_QUIET=1 mise use -g "${MISE_RUNTIMES[@]}" 2>&1 | log_quote || true
fi fi
# Activate mise shims so runtimes (e.g. python3) are available for app installers # Activate mise shims so runtimes (e.g. python3) are available for app installers
@@ -62,6 +62,12 @@ typeset -a MISE_APPS=(
"zoxide@latest" "zoxide@latest"
"ripgrep@latest" "ripgrep@latest"
"delta@latest" "delta@latest"
"eza@latest"
"fd@latest"
"sd@latest"
"bottom@latest"
"ubi:dalance/procs@latest"
"cargo:tealdeer@latest"
) )
if [[ "$DOTS_ENV" != "codespaces" ]]; then if [[ "$DOTS_ENV" != "codespaces" ]]; then
@@ -76,10 +82,10 @@ if [[ "$DOTS_ENV" != "codespaces" ]]; then
fi fi
log_info "Installing apps..." log_info "Installing apps..."
MISE_QUIET=1 mise use -g "${MISE_APPS[@]}" 2>&1 | log_quote MISE_QUIET=1 mise use -g "${MISE_APPS[@]}" 2>&1 | log_quote || true
# Rebuild bat theme cache with mise-installed bat (must match delta's syntect version) # Rebuild bat theme cache with mise-installed bat (must match delta's syntect version)
bat cache --build &>/dev/null bat cache --build &>/dev/null || true
if [[ "$DOTS_ENV" != "codespaces" ]]; then if [[ "$DOTS_ENV" != "codespaces" ]]; then
# Setup Poetry ZSH completions (XDG compliant) # Setup Poetry ZSH completions (XDG compliant)

View File

@@ -31,9 +31,10 @@ log_warn() { echo -e "${YELLOW}[WARN]${NC} $*"; }
log_error() { echo -e "${RED}[FAIL]${NC} $*"; } log_error() { echo -e "${RED}[FAIL]${NC} $*"; }
log_debug() { echo -e "${TEAL}$*${NC}"; } log_debug() { echo -e "${TEAL}$*${NC}"; }
log_quote() { sed "s/^/ ${GREY}│ /" | sed "s/$/${NC}/"; } log_quote() { sed "s/^/ ${GREY}│ /" | sed "s/$/${NC}/"; }
log_indent() { sed "s/^/ │ /"; }
# Export log functions # Export log functions
export -f log_info log_pass log_skip log_warn log_error log_debug log_quote export -f log_info log_pass log_skip log_warn log_error log_debug log_quote log_indent
printf "\n\t${TEAL} <<< ${TEAL_BOLD}dots${TEAL} >>> ${NC}\n" printf "\n\t${TEAL} <<< ${TEAL_BOLD}dots${TEAL} >>> ${NC}\n"
printf "\t${GREY}==============${NC}\n\n" printf "\t${GREY}==============${NC}\n\n"
@@ -138,10 +139,18 @@ run() {
# Cache brew package lists (avoid repeated slow brew queries in install scripts) # Cache brew package lists (avoid repeated slow brew queries in install scripts)
if [[ "$DOTS_PKG" == "brew" ]]; then if [[ "$DOTS_PKG" == "brew" ]]; then
log_info "Caching brew package lists..." log_info "Caching brew package lists..."
export BREW_CASKS=$(brew list --cask 2>/dev/null || true) local cask_versions_tmp=$(mktemp)
export BREW_FORMULAE=$(brew list 2>/dev/null || true) local formula_versions_tmp=$(mktemp)
export BREW_CASK_VERSIONS=$(brew list --cask --versions 2>/dev/null || true) brew list --cask --versions 2>/dev/null > "$cask_versions_tmp" &
export BREW_FORMULA_VERSIONS=$(brew list --versions 2>/dev/null || true) local cask_pid=$!
brew list --versions 2>/dev/null > "$formula_versions_tmp" &
local formula_pid=$!
wait "$cask_pid" "$formula_pid" 2>/dev/null || true
export BREW_CASK_VERSIONS=$(cat "$cask_versions_tmp")
export BREW_FORMULA_VERSIONS=$(cat "$formula_versions_tmp")
export BREW_CASKS=$(awk '{print $1}' <<< "$BREW_CASK_VERSIONS")
export BREW_FORMULAE=$(awk '{print $1}' <<< "$BREW_FORMULA_VERSIONS")
rm -f "$cask_versions_tmp" "$formula_versions_tmp"
fi fi
scripts=("$install_dir"/*.sh) scripts=("$install_dir"/*.sh)
@@ -155,8 +164,14 @@ run() {
fi fi
local script_name=$(basename "$script") local script_name=$(basename "$script")
local label=" ${script_name} "
local rule_width=40
local label_len=${#label}
local pad_len=$(( rule_width - label_len - 2 ))
(( pad_len < 2 )) && pad_len=2
local pad=$(printf '─%.0s' $(seq 1 "$pad_len"))
printf "\n\n${TEAL}<<< ${TEAL_BOLD}$script_name:${NC}\n" printf "\n${GREY}──${label}${pad}${NC}\n"
local start_ns=$(now_ns) local start_ns=$(now_ns)
source "$script" source "$script"
local end_ns=$(now_ns) local end_ns=$(now_ns)
@@ -170,8 +185,7 @@ run() {
else else
time_color="$RED" time_color="$RED"
fi fi
printf "${TEAL}>>> ${TEAL_BOLD}${script_name}, ${NC}" printf "${GREY}── ${time_color}${execution_ms_formatted}ms${NC}\n"
printf "completed in ${time_color}${execution_ms_formatted}ms${NC}\n"
done done
} }
log_info "Logging to \"$log_abs_target\"" log_info "Logging to \"$log_abs_target\""