INNER CODE UNIT · JavaScript
getVersion
agent-sh/agentsys · lib/binary/index.js:116
function getVersion() {
const binPath = getBinaryPath();
if (!fs.existsSync(binPath)) return null;
try {
const out = cp.execFileSync(binPath, ['--version'], {
timeout: 5000,
encoding: 'utf8',
stdio: ['pipe', 'pipe', 'pipe'],
windowsHide: true
});
const match = out.trim().match(/(\d+\.\d+\.\d+)/);
return match ? match[1] : out.trim();
} catch (e) {
return null;
}
}
// ---------------------------------------------------------------------------