MCPcopy Create free account
hub / github.com/alibaba/open-code-review / getInstalledVersion

Function getInstalledVersion

scripts/update.js:59–70  ·  view source on GitHub ↗
(binPath)

Source from the content-addressed store, hash-verified

57}
58
59function getInstalledVersion(binPath) {
60 try {
61 const result = spawnSync(binPath, ["version"], {
62 encoding: "utf8",
63 timeout: 3000,
64 });
65 const match = (result.stdout || "").match(/v(\d+\.\d+(?:\.\d+)?)/);
66 return match ? match[1] : null;
67 } catch (_) {
68 return null;
69 }
70}
71
72function fetchLatestVersion(pkg) {
73 const registry = (pkg.publishConfig && pkg.publishConfig.registry) || DEFAULT_REGISTRY;

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected