MCPcopy
hub / github.com/garrytan/gstack / readVersionHash

Function readVersionHash

browse/src/config.ts:148–155  ·  view source on GitHub ↗
(execPath: string = process.execPath)

Source from the content-addressed store, hash-verified

146 * Returns null if the file doesn't exist or can't be read.
147 */
148export function readVersionHash(execPath: string = process.execPath): string | null {
149 try {
150 const versionFile = path.resolve(path.dirname(execPath), '.version');
151 return fs.readFileSync(versionFile, 'utf-8').trim() || null;
152 } catch {
153 return null;
154 }
155}
156
157/**
158 * Resolve the gstack home directory.

Callers 3

config.test.tsFile · 0.90
ensureServerFunction · 0.90
startFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected