MCPcopy Create free account
hub / github.com/angular/dev-infra / determineRepoBaseDirFromCwd

Function determineRepoBaseDirFromCwd

ng-dev/utils/repo-directory.ts:12–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11/** Determines the repository base directory from the current working directory. */
12export function determineRepoBaseDirFromCwd() {
13 const {stdout, stderr, status} = ChildProcess.spawnSync('git', ['rev-parse', '--show-toplevel']);
14 if (status !== 0) {
15 throw Error(
16 `Unable to find the path to the base directory of the repository.\n` +
17 `Was the command run from inside of the repo?\n\n` +
18 `${stderr}`,
19 );
20 }
21 return stdout.trim();
22}

Callers 11

getCommitsInRangeFunction · 0.90
handlerFunction · 0.90
checkPortabilityFunction · 0.90
getBazelBinFunction · 0.85
ngDevVersionMiddlewareFunction · 0.85
getConfigFunction · 0.85
getUserConfigFunction · 0.85
constructorMethod · 0.85
handlerFunction · 0.85
builderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected