( currentVersion: string, options?: ResolveDistTagsOptions, )
| 218 | * Best-effort: an unreachable registry yields `updateAvailable: false`. |
| 219 | */ |
| 220 | export 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 | }; |
no test coverage detected