@halospv3/hce.shared-config
Version:
Automate commit message quality, changelogs, and CI/CD releases. Its `main` entry point is a Semantic Release config. Functions and classes are exposed for customization. An ESLint config, a Commitlint config, and addl. resources for .NET projects are als
33 lines • 1.62 kB
text/typescript
import { Type } from "arktype";
import { ExecException } from "node:child_process";
//#region src/utils/execAsync.d.ts
/**
* A `promisify(exec)` wrapper to optionally assign the child process's STDERR as the {@link Error.prototype.cause}.
* @see {@link promisify}, {@link exec}
* @param command The command to run, with space-separated arguments.
* @param [shouldSetStderrAsCause=false] If true and the child process's stderr is available, the thrown Error's {@link Error.prototype.cause} is assigned the stderr string.
* @returns A promise of the child process's STDOUT and STDERR streams as strings
* @throws {Error | ChildProcessSpawnException}
*/
declare function execAsync(command: string, shouldSetStderrAsCause?: boolean): Promise<{
stdout: string;
stderr: string;
}>;
declare const T_ExecException: Type<Error & Omit<ExecException, "cmd" | "code" | "signal"> & {
cmd?: ExecException["cmd"];
code?: number | string | undefined;
signal?: ExecException["signal"] | null;
}>;
type _ExecException = typeof T_ExecException.inferOut;
declare class ChildProcessSpawnException extends Error implements _ExecException {
cmd: typeof T_ExecException.inferOut.cmd;
code: typeof T_ExecException.inferOut.code;
killed: typeof T_ExecException.inferOut.killed;
signal: typeof T_ExecException.inferOut.signal;
stderr: typeof T_ExecException.inferOut.stderr;
stdout: typeof T_ExecException.inferOut.stdout;
constructor(message: Parameters<typeof Error>[0], options: typeof T_ExecException.inferIn);
}
//#endregion
export { ChildProcessSpawnException, execAsync };
//# sourceMappingURL=execAsync.d.mts.map