MCPcopy Index your code
hub / github.com/callstack/agent-device / spawnBackgroundUpdateCheck

Function spawnBackgroundUpdateCheck

src/utils/update-check.ts:140–150  ·  view source on GitHub ↗
(cachePath: string, currentVersion: string)

Source from the content-addressed store, hash-verified

138}
139
140function spawnBackgroundUpdateCheck(cachePath: string, currentVersion: string): void {
141 const modulePath = resolveUpdateCheckEntryModulePath();
142 const execArgs = modulePath.endsWith('.ts') ? ['--experimental-strip-types'] : [];
143 runCmdDetached(process.execPath, [
144 ...execArgs,
145 modulePath,
146 UPDATE_CHECK_ARG,
147 cachePath,
148 currentVersion,
149 ]);
150}
151
152async function fetchLatestPackageVersion(): Promise<string | undefined> {
153 const response = await fetch(`https://registry.npmjs.org/${PACKAGE_NAME}/latest`, {

Callers 1

maybeRunUpgradeNotifierFunction · 0.85

Calls 2

runCmdDetachedFunction · 0.90

Tested by

no test coverage detected