MCPcopy
hub / github.com/coder/mux / initGitRepo

Function initGitRepo

src/node/runtime/multiProjectRuntime.test.ts:12–25  ·  view source on GitHub ↗
(projectPath: string)

Source from the content-addressed store, hash-verified

10import { MultiProjectRuntime } from "./multiProjectRuntime";
11
12async function initGitRepo(projectPath: string): Promise<void> {
13 await fs.mkdir(projectPath, { recursive: true });
14 execFileSync("git", ["init", "-b", "main"], { cwd: projectPath, stdio: "ignore" });
15 execFileSync("git", ["config", "user.email", "test@example.com"], {
16 cwd: projectPath,
17 stdio: "ignore",
18 });
19 execFileSync("git", ["config", "user.name", "test"], { cwd: projectPath, stdio: "ignore" });
20 execFileSync("git", ["config", "commit.gpgsign", "false"], { cwd: projectPath, stdio: "ignore" });
21
22 await fs.writeFile(path.join(projectPath, "README.md"), "hello\n", "utf8");
23 execFileSync("git", ["add", "README.md"], { cwd: projectPath, stdio: "ignore" });
24 execFileSync("git", ["commit", "-m", "init"], { cwd: projectPath, stdio: "ignore" });
25}
26
27async function createWorkspaceWorktree(
28 projectPath: string,

Callers 1

Calls 1

writeFileMethod · 0.65

Tested by

no test coverage detected