(projectPath: string)
| 99 | * @returns true if the path contains a .git directory |
| 100 | */ |
| 101 | export async function isGitRepository(projectPath: string): Promise<boolean> { |
| 102 | const gitPath = path.join(projectPath, ".git"); |
| 103 | try { |
| 104 | await fs.stat(gitPath); |
| 105 | return true; |
| 106 | } catch { |
| 107 | return false; |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * Check whether `projectPath` lies inside a git work tree, even if `.git` |
no test coverage detected