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

Function resolveUpdateCheckEntryModulePath

src/utils/update-check.ts:124–138  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122}
123
124function resolveUpdateCheckEntryModulePath(): string {
125 const currentModulePath = fileURLToPath(import.meta.url);
126 const extension = path.extname(currentModulePath) || '.js';
127 const entryPaths = [
128 path.join(path.dirname(currentModulePath), `update-check-entry${extension}`),
129 path.join(path.dirname(currentModulePath), 'internal', `update-check-entry${extension}`),
130 ];
131 const entryPath = entryPaths.find((candidate) => fs.existsSync(candidate));
132 if (!entryPath) {
133 throw new Error(
134 'Update check entrypoint not found. Rebuild the package to include the update-check worker entry.',
135 );
136 }
137 return entryPath;
138}
139
140function spawnBackgroundUpdateCheck(cachePath: string, currentVersion: string): void {
141 const modulePath = resolveUpdateCheckEntryModulePath();

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected