( overlayPath: string, writtenPaths: Set<string>, cwd: string, )
| 98 | } |
| 99 | |
| 100 | async function copyOverlayToMain( |
| 101 | overlayPath: string, |
| 102 | writtenPaths: Set<string>, |
| 103 | cwd: string, |
| 104 | ): Promise<boolean> { |
| 105 | let allCopied = true |
| 106 | for (const rel of writtenPaths) { |
| 107 | const src = join(overlayPath, rel) |
| 108 | const dest = join(cwd, rel) |
| 109 | try { |
| 110 | await mkdir(dirname(dest), { recursive: true }) |
| 111 | await copyFile(src, dest) |
| 112 | } catch { |
| 113 | allCopied = false |
| 114 | logForDebugging(`[Speculation] Failed to copy ${rel} to main`) |
| 115 | } |
| 116 | } |
| 117 | return allCopied |
| 118 | } |
| 119 | |
| 120 | export type ActiveSpeculationState = Extract< |
| 121 | SpeculationState, |
no test coverage detected