MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / getVersionString

Function getVersionString

Support/SingleFileLibs/javascript/cli.js:103–112  ·  view source on GitHub ↗
(_ref)

Source from the content-addressed store, hash-verified

101 return await readText(join(repoRoot, path));
102 },
103 async getVersionString(_ref) {
104 // Try to mimic Python version: <latest tag> (<short sha>)
105 // For simplicity here, return just the short HEAD sha via git, falling back to 'unknown'
106 try {
107 const { execSync } = require('node:child_process');
108 const tag = execSync('git describe --tags --abbrev=0', { cwd: repoRoot, stdio: ['ignore', 'pipe', 'ignore'] }).toString().trim();
109 const sha = execSync('git rev-parse --short HEAD', { cwd: repoRoot, stdio: ['ignore', 'pipe', 'ignore'] }).toString().trim();
110 return `${tag} (${sha})`;
111 } catch { return 'unknown'; }
112 },
113 };
114
115 const libraries = args.all ? Object.keys(dependencies) : [args.library];

Callers

nothing calls this directly

Calls 2

trimMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected