(repoPath: string, files: Record<string, string>)
| 13 | } |
| 14 | |
| 15 | async function initGitRepo(repoPath: string, files: Record<string, string>): Promise<void> { |
| 16 | await fs.mkdir(repoPath, { recursive: true }); |
| 17 | git(repoPath, ["init", "-b", "main"]); |
| 18 | git(repoPath, ["config", "user.email", "test@example.com"]); |
| 19 | git(repoPath, ["config", "user.name", "test"]); |
| 20 | git(repoPath, ["config", "commit.gpgsign", "false"]); |
| 21 | |
| 22 | for (const [relativePath, content] of Object.entries(files)) { |
| 23 | const absolutePath = path.join(repoPath, relativePath); |
| 24 | await fs.mkdir(path.dirname(absolutePath), { recursive: true }); |
| 25 | await fs.writeFile(absolutePath, content, "utf-8"); |
| 26 | } |
| 27 | |
| 28 | git(repoPath, ["add", "."]); |
| 29 | git(repoPath, ["commit", "-m", "init"]); |
| 30 | } |
| 31 | |
| 32 | function createInitLogger() { |
| 33 | const steps: string[] = []; |
no test coverage detected