(runRoot, name, sha)
| 233 | } |
| 234 | |
| 235 | const createWorktree = (runRoot, name, sha) => { |
| 236 | const path = join(runRoot, name) |
| 237 | runGit(["worktree", "add", "--detach", path, sha]) |
| 238 | try { |
| 239 | linkDirectory(join(repoRoot, "node_modules"), join(path, "node_modules")) |
| 240 | linkDirectory(join(effectDir, "node_modules"), join(path, "packages", "effect", "node_modules")) |
| 241 | } catch (error) { |
| 242 | removeWorktree(path) |
| 243 | throw error |
| 244 | } |
| 245 | return path |
| 246 | } |
| 247 | |
| 248 | const removeWorktree = (path) => { |
| 249 | const result = run("git", ["worktree", "remove", "--force", path], { cwd: repoRoot }) |
no test coverage detected