MCPcopy
hub / github.com/google/zx / getFilepath

Function getFilepath

src/cli.ts:280–288  ·  view source on GitHub ↗
(cwd = '.', name = 'zx', _ext?: string)

Source from the content-addressed store, hash-verified

278
279// prettier-ignore
280function getFilepath(cwd = '.', name = 'zx', _ext?: string): string {
281 const ext = _ext || argv.ext || EXT
282 return [
283 name + ext,
284 name + '-' + randomId() + ext,
285 ]
286 .map(f => path.resolve(process.cwd(), cwd, f))
287 .find(f => !fs.existsSync(f))!
288}

Callers 1

readScriptFunction · 0.85

Calls 1

randomIdFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…