* Spawns the given command in a child process with the given options. * Special-cases the AMP task runner so that it is correctly spawned on all * platforms (node shebangs do not work on Windows). * * @param {string} cmd * @param {?Object} options * @return {!Object}
(cmd, options)
| 19 | * @return {!Object} |
| 20 | */ |
| 21 | function spawnProcess(cmd, options) { |
| 22 | const cmdToSpawn = cmd.startsWith('amp ') ? `node ${cmd}` : cmd; |
| 23 | return childProcess.spawnSync(cmdToSpawn, {shell: shellCmd, ...options}); |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * Executes the provided command, returning the process object. |