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

Function getInstalledVersion

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

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected