- Extract shared Windows command/process utilities - Add process tree kill and probe process wrappers - Cover output truncation and Windows command behavior with tests
18 lines
490 B
TypeScript
18 lines
490 B
TypeScript
import { runProcess, type ProcessRunOptions, type ProcessRunResult } from "../processRunner";
|
|
|
|
type ProcessRunner = typeof runProcess;
|
|
|
|
export type ProbeProcessOptions = Omit<ProcessRunOptions, "stdin" | "outputMode">;
|
|
|
|
export function runProbeProcess(
|
|
command: string,
|
|
args: readonly string[],
|
|
options: ProbeProcessOptions = {},
|
|
runner: ProcessRunner = runProcess,
|
|
): Promise<ProcessRunResult> {
|
|
return runner(command, args, {
|
|
...options,
|
|
outputMode: "truncate",
|
|
});
|
|
}
|