diff options
| author | Eddie Santos <[email protected]> | 2025-06-30 20:03:16 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-01 03:03:16 +0000 |
| commit | e5b1208bd8842d6517b5033a1fa20dd900bc2134 (patch) | |
| tree | 0b6368a35f326d4d6c6360e3d51f250b4436964b /packages/cli/src/ui/utils/updateCheck.ts | |
| parent | e10c208fbe076333ea82ec96d7f54f756992864c (diff) | |
update check + tests (#2772)
Diffstat (limited to 'packages/cli/src/ui/utils/updateCheck.ts')
| -rw-r--r-- | packages/cli/src/ui/utils/updateCheck.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/cli/src/ui/utils/updateCheck.ts b/packages/cli/src/ui/utils/updateCheck.ts index e6e6bd62..6be5effc 100644 --- a/packages/cli/src/ui/utils/updateCheck.ts +++ b/packages/cli/src/ui/utils/updateCheck.ts @@ -5,6 +5,7 @@ */ import updateNotifier from 'update-notifier'; +import semver from 'semver'; import { getPackageJson } from '../../utils/package.js'; export async function checkForUpdates(): Promise<string | null> { @@ -24,7 +25,10 @@ export async function checkForUpdates(): Promise<string | null> { shouldNotifyInNpmScript: true, }); - if (notifier.update) { + if ( + notifier.update && + semver.gt(notifier.update.latest, notifier.update.current) + ) { return `Gemini CLI update available! ${notifier.update.current} → ${notifier.update.latest}\nRun npm install -g ${packageJson.name} to update`; } |
