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

Function getVersion

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

Source from the content-addressed store, hash-verified

8const VERSION_CHECK_TAG = 'latest';
9
10export function getVersion() {
11 try {
12 // isomorphic __dirname
13 const _dirname = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url));
14 return JSON.parse(fs.readFileSync(path.join(_dirname, '../package.json'), 'utf8')).version;
15 } catch {
16 return undefined;
17 }
18}
19
20export async function checkNewVersion() {
21 const currVersion = getVersion();

Callers 4

createProgramFunction · 0.90
TelemetryClass · 0.90
createProxyAppFunction · 0.90
checkNewVersionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected