MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / checkForUpdate

Function checkForUpdate

packages/core/api/src/update-check.ts:220–231  ·  view source on GitHub ↗
(
  currentVersion: string,
  options?: ResolveDistTagsOptions,
)

Source from the content-addressed store, hash-verified

218 * Best-effort: an unreachable registry yields `updateAvailable: false`.
219 */
220export const checkForUpdate = async (
221 currentVersion: string,
222 options?: ResolveDistTagsOptions,
223): Promise<UpdateStatus> => {
224 const channel = resolveUpdateChannel(currentVersion);
225 const command = `npm i -g ${EXECUTOR_PACKAGE_NAME}@${channel}`;
226 const tags = await resolveDistTags(options);
227 const latestVersion = tags[channel] ?? null;
228 const updateAvailable =
229 latestVersion !== null && compareVersions(currentVersion, latestVersion) === -1;
230 return { updateAvailable, currentVersion, latestVersion, channel, command };
231};

Callers 2

runForegroundSessionFunction · 0.90

Calls 3

resolveUpdateChannelFunction · 0.85
resolveDistTagsFunction · 0.85
compareVersionsFunction · 0.70

Tested by

no test coverage detected