(cwd: string)
| 60 | } |
| 61 | |
| 62 | async function findProjectRoot(cwd: string): Promise<string> { |
| 63 | const start = normalize(cwd); |
| 64 | let current = start; |
| 65 | |
| 66 | while (true) { |
| 67 | if (await pathExists(join(current, '.git'))) return current; |
| 68 | const parent = dirname(current); |
| 69 | if (parent === current) return start; |
| 70 | current = parent; |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | async function pathExists(filePath: string): Promise<boolean> { |
| 75 | try { |
no test coverage detected