MCPcopy Create free account
hub / github.com/apache/maka / withHostPaths

Function withHostPaths

packages/runtime-host/src/__tests__/host-kernel.test.ts:2452–2468  ·  view source on GitHub ↗
(run: (paths: HostPaths) => Promise<void>)

Source from the content-addressed store, hash-verified

2450}
2451
2452async 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
2470function spawnConnectClient(
2471 paths: HostPaths,

Callers 1

Calls 4

closeMethod · 0.95
rmFunction · 0.85
runFunction · 0.70

Tested by

no test coverage detected