(dir: string)
| 23 | |
| 24 | /** @returns Whether or not this directory or a parent directory has a `.git` directory. */ |
| 25 | const isInsideGitRepo = async (dir: string): Promise<boolean> => { |
| 26 | try { |
| 27 | // If this command succeeds, we're inside a git repo |
| 28 | await execa("git", ["rev-parse", "--is-inside-work-tree"], { |
| 29 | cwd: dir, |
| 30 | stdout: "ignore", |
| 31 | }); |
| 32 | return true; |
| 33 | } catch (_e) { |
| 34 | // Else, it will throw a git-error and we return false |
| 35 | return false; |
| 36 | } |
| 37 | }; |
| 38 | |
| 39 | const getGitVersion = () => { |
| 40 | const stdout = execSync("git --version").toString().trim(); |
no outgoing calls
no test coverage detected
searching dependent graphs…