Suppress interactive prompts in Homebrew installs - #72
Conversation
thompsonson
left a comment
There was a problem hiding this comment.
Review
Overview
The PR's stated goal is narrow: add HOMEBREW_NO_INSTALL_CLEANUP=1 and CI=true to run_once_install-packages.sh.tmpl so chezmoi apply runs unattended. The actual diff touches two files, though, and roughly half the changes (all of dot_tmux.conf) are unrelated to that stated purpose.
⚠️ Scope mismatch (main concern)
dot_tmux.conf changes aren't mentioned anywhere in the PR title/body, but they're substantial:
default-terminalchanged fromscreen-256color→tmux-256color- The
dracula/tmuxplugin is removed and replaced with a ~35-line hand-rolled Nord-themed status bar - The "Remote Development Optimizations" section header is split to insert a new "Status Bar Configuration" section
None of this suppresses prompts or relates to Homebrew. Worth confirming this is intentional (e.g. a rebase artifact vs. deliberate bundling) — either split into two PRs, or update the description so reviewers aren't misled about scope. The tmux status bar itself looks functionally fine; it just deserves its own description. Minor cosmetic note: dot_zshrc still sets BAT_THEME="Dracula" for bat/fzf, so the color scheme is now inconsistent (Dracula in bat/fzf, Nord in tmux) — not a bug, just worth knowing.
run_once_install-packages.sh.tmpl
1. CI=true is exported unscoped for the rest of the script
Since this is one continuous bash process, export CI=true set inside install_brew_packages() / at the macOS global scope leaks into everything that runs afterward — pipx install, fnm/Node install, Docker setup, etc. Several CLI tools change behavior under CI (disabled prompts/color/progress), which is broader than "suppress Homebrew prompts." Consider scoping it directly to the brew calls instead:
CI=true HOMEBREW_NO_INSTALL_CLEANUP=1 brew install "$package"or unset CI once the brew-related sections finish.
2. Redundant duplicate exports
On macOS the exports are set at global scope (:367-368) and again inside install_with_progress() (:378-379). Since it's a single script process, the inner re-export is redundant — pick one location.
3. Minor style
Extra trailing blank lines left after each inserted export block (e.g. :144, :368-370, :379-381) — inconsistent with surrounding spacing.
4. Test coverage
tests/test.sh explicitly excludes .tmpl files from shellcheck ("Go templates confuse shellcheck"), so nothing in CI validates this file's shell syntax — not a regression from this PR, just a reminder that chezmoi execute-template + --dry-run (per CLAUDE.md's package workflow) is the only safety net here.
Summary
- Worth addressing: clarify or split out the unrelated tmux.conf changes.
- Worth addressing: scope
CI=truemore tightly, drop the duplicate export ininstall_with_progress. - Nice to have: trim extra blank lines.
The core Homebrew env-var fix itself is small, correct, and uses legitimate documented Homebrew behavior — no security concerns there.
Generated by Claude Code
300e275 to
7dfeffb
Compare
- Add HOMEBREW_NO_INSTALL_CLEANUP=1 to skip post-install prompts - Add CI=true to enable unattended mode for all brew operations - Apply to Linux brew function, macOS global scope, and macOS install function - Ensures chezmoi runs completely unattended without confirmation dialogs
7dfeffb to
9a22420
Compare
Updated per reviewAddressed all concerns from the code review: ✅ Rebased onto origin/main — removed unrelated tmux changes that were inadvertently included ✅ Scoped CI=true tightly — now only applied per-call as a prefix to brew commands:
✅ Removed redundant exports — kept global ✅ Cleaned up spacing — removed extra blank lines for consistency Summary of final approach:
|
- nono: kernel-enforced capability sandbox for AI agents - Available on macOS and Linux via lukehinds/nono tap - Supports Landlock (Linux) and Seatbelt (macOS) security primitives
Fixes unattended installation by adding Homebrew environment variables.
Changes
HOMEBREW_NO_INSTALL_CLEANUP=1to skip post-install promptsCI=trueto enable unattended/non-interactive modeResult
Chezmoi now runs completely unattended without confirmation dialogs or cleanup waits.