MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / cleanup

Function cleanup

apps/desktop/scripts/smoke-sidecar.ts:471–487  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

469 });
470
471 const cleanup = async () => {
472 if (exitCode === null) {
473 proc.kill("SIGTERM");
474 await Promise.race([proc.exited, Bun.sleep(3000)]);
475 if (exitCode === null) proc.kill("SIGKILL");
476 }
477 openapi.server.stop(true);
478 await restoreWorkspaceOnePasswordWasm(hiddenWorkspaceWasm);
479 // oxlint-disable-next-line executor/no-promise-catch -- boundary: best-effort tempdir cleanup in a standalone smoke harness
480 await rm(scopeDir, { recursive: true, force: true }).catch(() => {});
481 // oxlint-disable-next-line executor/no-promise-catch -- boundary: best-effort tempdir cleanup in a standalone smoke harness
482 await rm(dataDir, { recursive: true, force: true }).catch(() => {});
483 // oxlint-disable-next-line executor/no-promise-catch -- boundary: best-effort tempdir cleanup in a standalone smoke harness
484 await rm(xdgDir, { recursive: true, force: true }).catch(() => {});
485 // oxlint-disable-next-line executor/no-promise-catch -- boundary: best-effort tempdir cleanup in a standalone smoke harness
486 await rm(sidecarRoot, { recursive: true, force: true }).catch(() => {});
487 };
488
489 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: standalone smoke harness needs a finally to tear down the spawned binary + http server
490 try {

Callers 1

mainFunction · 0.70

Calls 1

Tested by

no test coverage detected