(workDir: string)
| 450 | } |
| 451 | |
| 452 | async function findProjectRoot(workDir: string): Promise<string> { |
| 453 | const start = path.resolve(workDir); |
| 454 | let current = start; |
| 455 | while (true) { |
| 456 | if (await exists(path.join(current, '.git'))) return current; |
| 457 | const parent = path.dirname(current); |
| 458 | if (parent === current) return start; |
| 459 | current = parent; |
| 460 | } |
| 461 | } |
| 462 | |
| 463 | async function exists(p: string): Promise<boolean> { |
| 464 | try { |
no test coverage detected