* Returns the current git repo's root directory if we are inside one. * @return {string|undefined}
()
| 17 | * @return {string|undefined} |
| 18 | */ |
| 19 | function getRepoRoot() { |
| 20 | const repoRootCmd = 'git rev-parse --show-toplevel'; |
| 21 | const result = childProcess.spawnSync(repoRootCmd, { |
| 22 | shell: process.platform == 'win32' ? 'cmd' : '/bin/bash', |
| 23 | encoding: 'utf-8', |
| 24 | }); |
| 25 | return result.status == 0 ? result.stdout.trim() : undefined; |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * Invokes the repo-local `amp` task runner if we are inside a git repository. |
no outgoing calls
no test coverage detected