()
| 10 | |
| 11 | /** Determines the repository base directory from the current working directory. */ |
| 12 | export 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 | } |
no outgoing calls
no test coverage detected