Skip to content

fix(setup): make Ghostty install bulletproof#2

Merged
bogdanmatasaru merged 1 commit into
mainfrom
fix/ghostty-bulletproof-install
Jun 23, 2026
Merged

fix(setup): make Ghostty install bulletproof#2
bogdanmatasaru merged 1 commit into
mainfrom
fix/ghostty-bulletproof-install

Conversation

@bogdanmatasaru

Copy link
Copy Markdown
Owner

Problem

On machines that already had a manually installed /Applications/Ghostty.app (direct .dmg, corporate image, MDM), brew install --cask ghostty fails with Error: It seems there is already an App at '/Applications/Ghostty.app'. The script warned and continued, and validate() then reported Ghostty (cask) — MISSING even though Ghostty was present — producing the alarming "1 problem(s)" output a colleague hit.

Fix

  • install_ghostty — sanity-checked, layered install:
    1. skip if Homebrew already manages the cask (idempotent);
    2. adopt a pre-existing Ghostty.app into Homebrew (--adopt) instead of colliding with it;
    3. retry once after brew update for flaky networks;
    4. --force replace as a last resort (only when an app is actually present).
  • Verify the outcome after every attempt (brew list --cask ghostty) instead of trusting the exit code.
  • validate() now detects Ghostty by brew cask or app bundle, removing the false-positive MISSING for non-brew installs.

Validation

  • bash -n clean; shellcheck clean for the new code.
  • Dry-run renders a single clean preview line (no spurious retry/force noise).
  • --check passes via the new ghostty_present predicate.
  • New code is comment-free, self-documenting, and DRY (shared presence predicates reused by install + validate).

🤖 Generated with Claude Code

The cask install failed on machines that already had a manually
installed /Applications/Ghostty.app: `brew install --cask ghostty`
errors with "already an App at ...", so validation reported Ghostty
MISSING even though the app was present.

- install_ghostty: skip when brew already manages it; adopt an existing
  app into Homebrew instead of colliding with it; retry once after
  `brew update` for flaky networks; force-replace as a last resort.
- Verify the outcome after every install attempt instead of trusting
  the exit code.
- validate(): detect Ghostty by brew cask OR app bundle, removing the
  false-positive MISSING for non-brew installs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bogdanmatasaru bogdanmatasaru merged commit 312d225 into main Jun 23, 2026
2 checks passed
@bogdanmatasaru bogdanmatasaru deleted the fix/ghostty-bulletproof-install branch June 23, 2026 09:49
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