Skip to content

Update README for homebrew and Improve Homebrew update handling#219

Merged
SaladDay merged 9 commits into
SaladDay:mainfrom
feiyehua:feiyehua/brew-readme
May 31, 2026
Merged

Update README for homebrew and Improve Homebrew update handling#219
SaladDay merged 9 commits into
SaladDay:mainfrom
feiyehua:feiyehua/brew-readme

Conversation

@feiyehua
Copy link
Copy Markdown
Collaborator

@feiyehua feiyehua commented May 30, 2026

This PR updates the Homebrew installation guidance and prevents Homebrew-managed binaries from being replaced by the built-in updater. Follow up of #207.

Changes

  • Updates the README installation instructions for Homebrew.
  • Detects when cc-switch is running from a Homebrew-managed prefix.
  • Allows cc-switch update to still check for the latest version under Homebrew.
  • Shows a package-manager-specific message when an update is available:
    brew upgrade cc-switch
  • Blocks explicit self-updates like cc-switch update --version ... for Homebrew-managed installs.
  • Prevents TUI update confirmation/download flows from attempting to replace a Homebrew-managed binary.
  • Shows the TUI Homebrew update message as two lines for readability.
  • Adds tests for CLI update behavior, TUI update handling, Homebrew-managed installs, non-Homebrew update checks, and custom repo URL update checks.

Testing

  • cargo fmt --check
  • cargo test --lib homebrew
  • cargo test --lib check_for_update_from_repo
  • cargo test --lib non_homebrew_update_check_marks_newer_version_as_regular_update
  • cargo test --lib update_check_finished_for_homebrew_update_shows_brew_toast

@SaladDay SaladDay self-requested a review May 31, 2026 07:14
@SaladDay
Copy link
Copy Markdown
Owner

LGTM, THANKS

@SaladDay SaladDay merged commit aed7252 into SaladDay:main May 31, 2026
2 checks passed
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.

2 participants