MCPcopy Create free account
hub / github.com/NomicFoundation/hardhat / runPostProcess

Function runPostProcess

scripts/profiler/main.ts:447–467  ·  view source on GitHub ↗

Runs a post-processing shell pipeline; returns whether it succeeded.

(pipeline: string)

Source from the content-addressed store, hash-verified

445
446/** Runs a post-processing shell pipeline; returns whether it succeeded. */
447function runPostProcess(pipeline: string): boolean {
448 // The pipelines write their data to files themselves, so only stderr —
449 // which carries the diagnosis on failure — is captured. perf can emit
450 // megabytes of non-fatal stderr noise even on success, so the buffer is
451 // sized well above the default to not kill a healthy pipeline.
452 const result = spawnSync("bash", ["-c", pipeline], {
453 stdio: ["ignore", "ignore", "pipe"],
454 encoding: "utf-8",
455 maxBuffer: 16 * 1024 * 1024,
456 });
457
458 if (result.status !== 0) {
459 logWarning(
460 `post-processing failed (exit ${String(result.status)}): ${pipeline}\n` +
461 ` ${stderrTail(result.stderr)}`,
462 );
463 return false;
464 }
465
466 return true;
467}
468
469/**
470 * The last few stderr lines of a failed command, as an indented block for a

Callers 1

profileSystemFunction · 0.85

Calls 2

logWarningFunction · 0.90
stderrTailFunction · 0.85

Tested by

no test coverage detected