Skip to content

fix: improve update command resolution and restrict brew updates to stable#87

Merged
designcode merged 3 commits intomainfrom
fix/update-command
Apr 13, 2026
Merged

fix: improve update command resolution and restrict brew updates to stable#87
designcode merged 3 commits intomainfrom
fix/update-command

Conversation

@designcode
Copy link
Copy Markdown
Collaborator

@designcode designcode commented Apr 12, 2026

Summary

  • Replace execSync('brew list tigris') with realpathSync(process.execPath) for Homebrew detection — faster (no subprocess) and correctly identifies this binary's install method
  • Restrict update-homebrew workflow job to only run on the release branch, preventing beta releases (via workflow_dispatch) from updating the Homebrew formula

Test plan

  • Verify getUpdateCommand() returns brew upgrade tigris when running from a Homebrew-installed binary
  • Verify getUpdateCommand() returns curl/npm commands for non-Homebrew installs
  • Verify update-homebrew job is skipped on workflow_dispatch runs
  • Verify update-homebrew job runs on pushes to release

🤖 Generated with Claude Code


Note

Medium Risk
Changes the CLI’s update-path detection and alters release automation conditions, which could impact the upgrade instructions shown to users and when the Homebrew formula is updated. Scope is small but affects distribution/update behavior.

Overview
Improves how the CLI decides which self-update command to suggest by detecting Homebrew installs via realpathSync(process.execPath) instead of running brew, and by ordering checks to avoid misclassifying npm installs when Node itself comes from Homebrew.

Restricts the update-homebrew GitHub Actions job to only run for releases on the release branch, preventing workflow_dispatch/non-branch runs from updating the Homebrew formula.

Reviewed by Cursor Bugbot for commit 8e6fcc5. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Homebrew check triggers falsely for npm installs with Homebrew Node
    • I restored the update command logic to check Homebrew only after confirming binary mode so npm-installed users always receive the npm upgrade command.

Create PR

Or push these changes by commenting:

@cursor push fdd3a724d9
Preview (fdd3a724d9)
diff --git a/src/utils/update-check.ts b/src/utils/update-check.ts
--- a/src/utils/update-check.ts
+++ b/src/utils/update-check.ts
@@ -106,15 +106,13 @@
  * Returns the platform-appropriate shell command for updating the CLI.
  */
 export function getUpdateCommand(): string {
-  if (isHomebrewInstall()) {
-    return 'brew upgrade tigris';
-  }
-
   const isBinary =
     (globalThis as { __TIGRIS_BINARY?: boolean }).__TIGRIS_BINARY === true;
 
   if (!isBinary) {
     return 'npm install -g @tigrisdata/cli';
+  } else if (isHomebrewInstall()) {
+    return 'brew upgrade tigris';
   } else if (process.platform === 'win32') {
     return 'irm https://github.com/tigrisdata/cli/releases/latest/download/install.ps1 | iex';
   } else {

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c16663e. Configure here.

Comment thread src/utils/update-check.ts Outdated
When installed via npm, process.execPath points to Node — not our
binary. If Node itself was installed via Homebrew, the Cellar path
check would falsely return "brew upgrade" instead of "npm install -g".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@designcode designcode merged commit 7f2ff38 into main Apr 13, 2026
3 checks passed
@designcode designcode deleted the fix/update-command branch April 13, 2026 08:25
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.18.0-beta.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants