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