(cmd, options = {})
| 65 | }, |
| 66 | |
| 67 | spawnSync(cmd, options = {}) { |
| 68 | const [command, ...args] = cmd; |
| 69 | const result = spawnSync(command, args, { |
| 70 | stdio: [ |
| 71 | options.stdin || 'pipe', |
| 72 | options.stdout === 'pipe' ? 'pipe' : 'ignore', |
| 73 | options.stderr === 'pipe' ? 'pipe' : 'ignore', |
| 74 | ], |
| 75 | timeout: options.timeout, |
| 76 | env: options.env, |
| 77 | cwd: options.cwd, |
| 78 | }); |
| 79 | |
| 80 | return { |
| 81 | exitCode: result.status, |
| 82 | stdout: result.stdout || Buffer.from(''), |
| 83 | stderr: result.stderr || Buffer.from(''), |
| 84 | }; |
| 85 | }, |
| 86 | |
| 87 | spawn(cmd, options = {}) { |
| 88 | const [command, ...args] = cmd; |
no outgoing calls