MCPcopy Create free account
hub / github.com/EvoMap/evolver / isGitWorkspace

Function isGitWorkspace

src/adapters/scripts/_runtimePaths.js:410–424  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

408// one-line "evolver needs a git workspace" notice, so a false negative just
409// suppresses the notice rather than breaking anything.
410function isGitWorkspace(dir) {
411 try {
412 const res = spawnSync('git', ['rev-parse', '--is-inside-work-tree'], {
413 cwd: dir,
414 encoding: 'utf8',
415 timeout: 5000,
416 stdio: ['ignore', 'pipe', 'pipe'],
417 shell: false,
418 windowsHide: true,
419 });
420 return res.status === 0 && typeof res.stdout === 'string' && res.stdout.trim() === 'true';
421 } catch {
422 return false;
423 }
424}
425
426module.exports = {
427 findEvolverRoot,

Callers 1

runInjectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected