Skip to content

fix(upgrade): refuse to upgrade Homebrew-managed binary#105

Merged
pszymkowiak merged 1 commit intomainfrom
fix/upgrade-brew-detection
Apr 12, 2026
Merged

fix(upgrade): refuse to upgrade Homebrew-managed binary#105
pszymkowiak merged 1 commit intomainfrom
fix/upgrade-brew-detection

Conversation

@pszymkowiak
Copy link
Copy Markdown
Contributor

Prevents icm upgrade --apply from breaking Homebrew/apt/dnf metadata. Detects /Cellar/ or /homebrew/ in the current exe path and tells user to use brew upgrade icm instead.

@pszymkowiak pszymkowiak added enhancement New feature or request packaging labels Apr 12, 2026
@pszymkowiak
Copy link
Copy Markdown
Contributor Author

wshm · Automated triage by AI

📊 Automated PR Analysis

Type feature
🟡 Risk medium

Summary

Adds a self-upgrade command (icm upgrade) that downloads the latest release from GitHub with SHA256 verification, and detects Homebrew/package-manager installations to prevent breaking their metadata by refusing to self-replace in those environments.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Analyzed automatically by wshm · This is an automated analysis, not a human review.

Detects /Cellar/ or /homebrew/ in current_exe() path and aborts with
a message directing user to 'brew upgrade icm'. Prevents breaking the
Cellar structure and Homebrew metadata.

Also warns for /usr/bin and /opt/ (non-brew) paths which may be managed
by apt/dnf/rpm.
@pszymkowiak pszymkowiak force-pushed the fix/upgrade-brew-detection branch from 250708b to 6d919a1 Compare April 12, 2026 19:59
@pszymkowiak pszymkowiak merged commit d6a90e5 into main Apr 12, 2026
4 checks passed
pszymkowiak added a commit to wshm-dev/wshm that referenced this pull request Apr 12, 2026
Detects /Cellar/ or /homebrew/ in current_exe() path and aborts with
a message directing user to 'brew upgrade wshm'. Prevents breaking the
Cellar structure and Homebrew metadata.

Also warns for /usr/bin/ paths which may be managed by apt/dnf/rpm.
Same pattern as rtk-ai/icm#105.
pszymkowiak added a commit to wshm-dev/wshm that referenced this pull request Apr 12, 2026
Detects /Cellar/ or /homebrew/ in current_exe() path and aborts with
a message directing user to 'brew upgrade wshm'. Prevents breaking the
Cellar structure and Homebrew metadata.

Also warns for /usr/bin/ paths which may be managed by apt/dnf/rpm.
Same pattern as rtk-ai/icm#105.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request packaging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant