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