(
command: string,
workingDirectory: string | undefined,
env: NodeJS.ProcessEnv
)
| 57 | } |
| 58 | |
| 59 | export async function execChildProcess( |
| 60 | command: string, |
| 61 | workingDirectory: string | undefined, |
| 62 | env: NodeJS.ProcessEnv |
| 63 | ): Promise<string> { |
| 64 | return new Promise<string>((resolve, reject) => { |
| 65 | cp.exec(command, { cwd: workingDirectory, maxBuffer: 500 * 1024, env: env }, (error, stdout, stderr) => { |
| 66 | if (error) { |
| 67 | reject( |
| 68 | new Error(`${error} |
| 69 | ${stdout} |
| 70 | ${stderr}`) |
| 71 | ); |
| 72 | } else if (stderr && !stderr.includes('screen size is bogus')) { |
| 73 | reject(new Error(stderr)); |
| 74 | } else { |
| 75 | resolve(stdout); |
| 76 | } |
| 77 | }); |
| 78 | }); |
| 79 | } |
| 80 | |
| 81 | export async function getUnixChildProcessIds(pid: number): Promise<number[]> { |
| 82 | return new Promise<number[]>((resolve, reject) => { |
no outgoing calls
no test coverage detected