MCPcopy Index your code
hub / github.com/coder/mux / createWorkspaceWorktree

Function createWorkspaceWorktree

src/node/runtime/multiProjectRuntime.test.ts:27–39  ·  view source on GitHub ↗
(
  projectPath: string,
  srcBaseDir: string,
  workspaceName: string
)

Source from the content-addressed store, hash-verified

25}
26
27async function createWorkspaceWorktree(
28 projectPath: string,
29 srcBaseDir: string,
30 workspaceName: string
31): Promise<string> {
32 const workspacePath = path.join(srcBaseDir, path.basename(projectPath), workspaceName);
33 await fs.mkdir(path.dirname(workspacePath), { recursive: true });
34 execFileSync("git", ["worktree", "add", "-b", workspaceName, workspacePath, "main"], {
35 cwd: projectPath,
36 stdio: "ignore",
37 });
38 return workspacePath;
39}
40
41describe("MultiProjectRuntime", () => {
42 let rootDir: string;

Callers 1

Calls 1

basenameMethod · 0.45

Tested by

no test coverage detected