mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-06 03:10:42 -07:00
Only check for updates if disableUpdateNag is false (#11405)
This commit is contained in:
@@ -8,6 +8,7 @@ import type { UpdateInfo } from 'update-notifier';
|
||||
import updateNotifier from 'update-notifier';
|
||||
import semver from 'semver';
|
||||
import { getPackageJson } from '../../utils/package.js';
|
||||
import type { LoadedSettings } from '../../config/settings.js';
|
||||
|
||||
export const FETCH_TIMEOUT_MS = 2000;
|
||||
|
||||
@@ -39,8 +40,13 @@ function getBestAvailableUpdate(
|
||||
return semver.gt(stableVer, nightlyVer) ? stable : nightly;
|
||||
}
|
||||
|
||||
export async function checkForUpdates(): Promise<UpdateObject | null> {
|
||||
export async function checkForUpdates(
|
||||
settings: LoadedSettings,
|
||||
): Promise<UpdateObject | null> {
|
||||
try {
|
||||
if (settings.merged.general?.disableUpdateNag) {
|
||||
return null;
|
||||
}
|
||||
// Skip update check when running from source (development mode)
|
||||
if (process.env['DEV'] === 'true') {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user