Skip to content

feat: suppress already-installed output for apt, homebrew, and mise - #186

Merged
jiminu merged 2 commits into
mainfrom
feat/suppress-already-installed-output
Sep 9, 2026
Merged

feat: suppress already-installed output for apt, homebrew, and mise#186
jiminu merged 2 commits into
mainfrom
feat/suppress-already-installed-output

Conversation

@jiminu

@jiminu jiminu commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Summary

When running selfishell update (or update --tools-only, install), packages and tools that are already installed previously printed verbose status lines on every run:

  • Apt: printed Already installed apt packages (10): ... and Already installed apt packages (2): ...
  • Homebrew: printed Already installed Homebrew formula/cask (N): ...
  • mise: printed mise <tool>@<version> ⇢ already installed for each configured runtime

In accordance with Selfishell's UX principle of suppressing unchanged/already-up-to-date output (similar to Neovim plugins, direct dependencies, and managed files/links), this PR silences these messages when everything is already installed:

  1. Apt / Homebrew:

    • Removed Already installed apt packages and Already installed Homebrew console outputs and unused tracking arrays.
    • When all packages are already installed, they complete silently without terminal noise. Missing packages and warnings/errors continue to be reported normally.
  2. mise:

    • Added a native preflight check via mise -q install --dry-run-code "$@".
    • If all tools are already installed (exit 0), install_mise_tools returns immediately without printing ⇢ already installed lines.
    • If the preflight returns non-zero, it falls through to the regular mise install, which either installs missing tools or surfaces the real error.

Verification

  • Added test_apt_suppresses_already_installed_output and test_homebrew_suppresses_already_installed_output in tests/package_adapters_test.bash
  • Enhanced test_installs_declared_mise_tools_with_managed_config in tests/installers_test.bash to verify the preflight-to-fallback execution sequence when tools need installing
  • Added test_skips_mise_install_when_tools_are_already_installed in tests/installers_test.bash to verify preflight success skips the install phase
  • Ran full repository check gate (bash scripts/check.sh) locally: syntax, shellcheck, shfmt, and all test suites pass with 0 failures.

@jiminu
jiminu marked this pull request as ready for review September 9, 2026 14:57
@jiminu
jiminu merged commit ca231c5 into main Sep 9, 2026
7 checks passed
@jiminu
jiminu deleted the feat/suppress-already-installed-output branch September 9, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant