MCPcopy Index your code
hub / github.com/zenstackhq/zenstack / checkNewVersion

Function checkNewVersion

packages/cli/src/utils/version-utils.ts:20–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18}
19
20export async function checkNewVersion() {
21 const currVersion = getVersion();
22 let latestVersion: string;
23 try {
24 latestVersion = await getLatestVersion();
25 } catch {
26 // noop
27 return;
28 }
29
30 if (latestVersion && currVersion && semver.gt(latestVersion, currVersion)) {
31 console.log(`A newer version ${colors.cyan(latestVersion)} is available.`);
32 }
33}
34
35export async function getLatestVersion() {
36 const fetchResult = await fetch(`https://registry.npmjs.org/@zenstackhq/cli/${VERSION_CHECK_TAG}`, {

Callers 1

createProgramFunction · 0.90

Calls 3

getVersionFunction · 0.85
getLatestVersionFunction · 0.85
logMethod · 0.65

Tested by

no test coverage detected