1
0
Fork 0

Move bat cargo install from run_once_20 to run_onchange_30

run_once_20 runs BEFORE run_onchange_30 in the bootstrap chain, so
'command -v cargo' inside run_once_20 was always false on a fresh
box — cargo install bat was skipped, leaving bat missing on debian.

Move the bat install to run_onchange_30 (which runs last, after
rustup is installed). Restructure the script to:
1. Ensure cargo is installed (existing logic)
2. Install bat via cargo on debian only (new logic, gated by os_family)

This way the bootstrap chain becomes:
  run_once_00 -> run_once_10 -> run_once_20 (apt packages, neovim, oh-my-zsh, font)
  -> run_onchange_30 (rustup, then bat from crates.io)

Crouton currently has rustup installed but no bat (cargo install
in progress in background). Re-running chezmoi init will skip
run_once_20 (state recorded) and re-run run_onchange_30 (content
changed), which will see bat missing and trigger cargo install
automatically.
This commit is contained in:
Rain 2026-06-21 22:50:08 -04:00
parent b731141f5a
commit 06d5826035
2 changed files with 34 additions and 22 deletions

View file

@ -64,13 +64,8 @@ if command -v fdfind >/dev/null 2>&1 && ! command -v fd >/dev/null 2>&1; then
fi
# Debian ships 'bat' as 'batcat' due to a name clash with an unrelated
# package. Install upstream 'bat' via cargo so we get the real binary at
# $HOME/.cargo/bin/bat. Faster than apt's renamed package, version-aligned
# with arch's pacman install.
if command -v cargo >/dev/null 2>&1 && ! command -v bat >/dev/null 2>&1; then
log "installing bat via cargo (upstream, debian renames it to batcat)"
cargo install bat --locked 2>&1 | tail -5
fi
# package. The install happens in run_onchange_30 (after rustup is ready,
# via `cargo install bat`).
# Neovim — install official binary tarball, pinned to a known-good version.
# Bump NVIM_TARGET_VERSION to upgrade. ~/.local/bin/update-neovim.sh does