(run: (paths: HostPaths) => Promise<void>)
| 2450 | } |
| 2451 | |
| 2452 | async function withHostPaths(run: (paths: HostPaths) => Promise<void>): Promise<void> { |
| 2453 | const base = await mkdtemp(join(tmpdir(), 'maka-runtime-host-')); |
| 2454 | const resources = new HostTestResources(); |
| 2455 | const paths = { |
| 2456 | base, |
| 2457 | root: join(base, 'root'), |
| 2458 | resources, |
| 2459 | }; |
| 2460 | try { |
| 2461 | await run(paths); |
| 2462 | } finally { |
| 2463 | await resources.close(); |
| 2464 | await removeControlDirectoriesForRootsUnder(base); |
| 2465 | await chmod(base, 0o700).catch(() => undefined); |
| 2466 | await rm(base, { recursive: true, force: true }); |
| 2467 | } |
| 2468 | } |
| 2469 | |
| 2470 | function spawnConnectClient( |
| 2471 | paths: HostPaths, |
no test coverage detected