MCPcopy
hub / github.com/streamich/git-cz / getGitRootDir

Function getGitRootDir

lib/util/getGitRootDir.js:3–10  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1const {execSync} = require('child_process');
2
3const getGitRootDir = () => {
4 const devNull = process.platform === 'win32' ? ' nul' : '/dev/null';
5 const dir = execSync('git rev-parse --show-toplevel 2>' + devNull)
6 .toString()
7 .trim();
8
9 return dir;
10};
11
12module.exports = getGitRootDir;

Callers 1

createStateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…