MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / initVersionManager

Function initVersionManager

daemon/src/service/version.ts:8–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6const PACKAGE_JSON = "package.json";
7
8export function initVersionManager() {
9 try {
10 GlobalVariable.set("version", "Unknown");
11 if (fs.existsSync(PACKAGE_JSON)) {
12 const data: any = JSON.parse(fs.readFileSync(PACKAGE_JSON, { encoding: "utf-8" }));
13 if (data.version) {
14 GlobalVariable.set("version", data.version);
15 }
16 }
17 } catch (error: any) {
18 logger.error($t("TXT_CODE_version.versionDetectErr"), error);
19 }
20}
21
22export function getVersion() {
23 return GlobalVariable.get("version", "Unknown");

Callers 1

app.tsFile · 0.90

Calls 3

$tFunction · 0.90
errorMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected