(
file: string,
args: string[],
options: ExecFileOptions = {
timeout: 10 * SECONDS_IN_MINUTE * MS_IN_SECOND,
preserveOutputOnError: true,
useCwd: true,
},
)
| 26 | } |
| 27 | |
| 28 | export function execFileNoThrow( |
| 29 | file: string, |
| 30 | args: string[], |
| 31 | options: ExecFileOptions = { |
| 32 | timeout: 10 * SECONDS_IN_MINUTE * MS_IN_SECOND, |
| 33 | preserveOutputOnError: true, |
| 34 | useCwd: true, |
| 35 | }, |
| 36 | ): Promise<{ stdout: string; stderr: string; code: number; error?: string }> { |
| 37 | return execFileNoThrowWithCwd(file, args, { |
| 38 | abortSignal: options.abortSignal, |
| 39 | timeout: options.timeout, |
| 40 | preserveOutputOnError: options.preserveOutputOnError, |
| 41 | cwd: options.useCwd ? getCwd() : undefined, |
| 42 | env: options.env, |
| 43 | stdin: options.stdin, |
| 44 | input: options.input, |
| 45 | }) |
| 46 | } |
| 47 | |
| 48 | type ExecFileWithCwdOptions = { |
| 49 | abortSignal?: AbortSignal |
no test coverage detected