MCPcopy Create free account
hub / github.com/coder/mux / cleanupRuntimePatchFile

Function cleanupRuntimePatchFile

src/node/services/tools/task_apply_git_patch.ts:1487–1521  ·  view source on GitHub ↗
(params: {
  runtime: ToolConfiguration["runtime"];
  repoCwd: string;
  remotePatchPath: string;
  taskId: string;
  workspaceId: string;
})

Source from the content-addressed store, hash-verified

1485}
1486
1487async function cleanupRuntimePatchFile(params: {
1488 runtime: ToolConfiguration["runtime"];
1489 repoCwd: string;
1490 remotePatchPath: string;
1491 taskId: string;
1492 workspaceId: string;
1493}): Promise<void> {
1494 try {
1495 const result = await execBuffered(
1496 params.runtime,
1497 `rm -f ${shellQuote(params.remotePatchPath)}`,
1498 {
1499 cwd: params.repoCwd,
1500 timeout: 30,
1501 }
1502 );
1503 if (result.exitCode !== 0) {
1504 log.debug("task_apply_git_patch: patch file cleanup failed", {
1505 taskId: params.taskId,
1506 workspaceId: params.workspaceId,
1507 remotePatchPath: params.remotePatchPath,
1508 exitCode: result.exitCode,
1509 stderr: result.stderr.trim(),
1510 stdout: result.stdout.trim(),
1511 });
1512 }
1513 } catch (error: unknown) {
1514 log.debug("task_apply_git_patch: patch file cleanup threw", {
1515 taskId: params.taskId,
1516 workspaceId: params.workspaceId,
1517 remotePatchPath: params.remotePatchPath,
1518 error,
1519 });
1520 }
1521}
1522
1523export async function applyTaskGitPatchArtifact(
1524 config: TaskApplyGitPatchConfiguration,

Callers 1

applyProjectPatchFunction · 0.85

Calls 3

execBufferedFunction · 0.90
shellQuoteFunction · 0.90
debugMethod · 0.80

Tested by

no test coverage detected