MCPcopy Index your code
hub / github.com/upstash/context7 / markUpdateNotificationShown

Function markUpdateNotificationShown

packages/cli/src/utils/update-check.ts:282–296  ·  view source on GitHub ↗
(
  latestVersion: string,
  options: { now?: number; stateFile?: string } = {}
)

Source from the content-addressed store, hash-verified

280}
281
282export async function markUpdateNotificationShown(
283 latestVersion: string,
284 options: { now?: number; stateFile?: string } = {}
285): Promise<void> {
286 const now = options.now ?? Date.now();
287 const state = await readUpdateState(options.stateFile);
288 await writeUpdateState(
289 {
290 ...state,
291 notifiedVersion: latestVersion,
292 lastNotifiedAt: now,
293 },
294 options.stateFile
295 );
296}
297
298export function shouldSkipUpdateNotifier(argv = process.argv): boolean {
299 return argv.includes("--json") || argv.includes("-v") || argv.includes("--version");

Callers 3

maybeShowUpgradeNoticeFunction · 0.85

Calls 2

readUpdateStateFunction · 0.85
writeUpdateStateFunction · 0.85

Tested by

no test coverage detected