summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/utils/updateCheck.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/cli/src/ui/utils/updateCheck.ts')
-rw-r--r--packages/cli/src/ui/utils/updateCheck.ts6
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`;
}