(kaos: Kaos, workDir: string)
| 129 | } |
| 130 | |
| 131 | async function findProjectRoot(kaos: Kaos, workDir: string): Promise<string> { |
| 132 | const initial = kaos.normpath(workDir); |
| 133 | let current = initial; |
| 134 | |
| 135 | while (true) { |
| 136 | if (await pathExists(kaos, join(current, '.git'))) return current; |
| 137 | const parent = dirname(current); |
| 138 | if (parent === current) return initial; |
| 139 | current = parent; |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | function dirsRootToLeaf(kaos: Kaos, workDir: string, projectRoot: string): string[] { |
| 144 | const dirs: string[] = []; |
no test coverage detected