Skip to content

feat: update command#57

Merged
designcode merged 2 commits intomainfrom
feat/update-command
Mar 30, 2026
Merged

feat: update command#57
designcode merged 2 commits intomainfrom
feat/update-command

Conversation

@designcode
Copy link
Copy Markdown
Collaborator

@designcode designcode commented Mar 30, 2026

Note

Medium Risk
Adds a new self-update command that executes platform-specific shell commands (execSync), which can impact user environments if the command selection or output handling is wrong. Also increases update check/notify frequency and refactors update-version fetching to throw errors in more cases, changing runtime behavior.

Overview
Adds a new tigris update command that fetches the latest published version, reports status (including JSON output), and runs a platform-appropriate upgrade command.

Refactors update-check utilities by extracting getUpdateCommand, exposing readUpdateCache, and turning the registry fetch into an exported fetchLatestVersion that updates cache and surfaces network/parse errors (background checks still fail silently).

Shortens update check/notification intervals and changes the update banner to instruct users to run tigris update. Release workflow now runs test and test:integration instead of test:all.

Written by Cursor Bugbot for commit 05cecff. This will update automatically on new commits. Configure here.

…rets

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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 2 potential issues.

Fix All in Cursor

Bugbot Autofix prepared fixes for both issues found in the latest run.

  • ✅ Fixed: Windows update fails: PowerShell command run in cmd.exe
    • The update command now runs with shell: 'powershell.exe' on Windows so PowerShell-only syntax executes correctly.
  • ✅ Fixed: Explicit update command uses stale cached version
    • The explicit update flow now always calls fetchLatestVersion() instead of using the 6-hour cache.

Create PR

Or push these changes by commenting:

@cursor push 644e05d676
Preview (644e05d676)
diff --git a/src/lib/update.ts b/src/lib/update.ts
--- a/src/lib/update.ts
+++ b/src/lib/update.ts
@@ -10,12 +10,10 @@
   fetchLatestVersion,
   getUpdateCommand,
   isNewerVersion,
-  readUpdateCache,
 } from '@utils/update-check.js';
 import { execSync } from 'child_process';
 
 import { version as currentVersion } from '../../package.json';
-import { UPDATE_CHECK_INTERVAL_MS } from '../constants.js';
 
 const context = msg('update');
 
@@ -27,14 +25,7 @@
   printStart(context);
 
   try {
-    // Determine latest version: use cache if fresh, otherwise fetch
-    let latestVersion: string;
-    const cache = readUpdateCache();
-    if (cache && Date.now() - cache.lastChecked < UPDATE_CHECK_INTERVAL_MS) {
-      latestVersion = cache.latestVersion;
-    } else {
-      latestVersion = await fetchLatestVersion();
-    }
+    const latestVersion = await fetchLatestVersion();
 
     const updateAvailable = isNewerVersion(currentVersion, latestVersion);
     const updateCommand = getUpdateCommand();
@@ -56,7 +47,10 @@
     if (updateAvailable) {
       console.log(`Latest version:  ${latestVersion}`);
       console.log('Updating...');
-      execSync(updateCommand, { stdio: 'inherit' });
+      execSync(updateCommand, {
+        stdio: 'inherit',
+        ...(process.platform === 'win32' ? { shell: 'powershell.exe' } : {}),
+      });
       printSuccess(context, { latestVersion });
     } else {
       printAlreadyDone(context, { currentVersion });

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

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@designcode designcode force-pushed the feat/update-command branch from 2e8cf2e to 05cecff Compare March 30, 2026 13:15
@designcode designcode merged commit e51c01e into main Mar 30, 2026
5 checks passed
@designcode designcode deleted the feat/update-command branch March 30, 2026 13:31
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.14.0-beta.3 🎉

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