* Get git repo root from a directory
(dir: string)
| 151 | * Get git repo root from a directory |
| 152 | */ |
| 153 | async function getGitRoot(dir: string): Promise<string | null> { |
| 154 | const result = await execCmd("git", ["rev-parse", "--show-toplevel"], dir) |
| 155 | return result.success ? result.stdout.trim() : null |
| 156 | } |
| 157 | |
| 158 | /** |
| 159 | * Get the relative path from git root to dir |
no test coverage detected