* Run a command in the terminal using exec, and wrap it in a promise * @param {string} cmd The command line command + args to execute * @param {ExecOptions} options, see here for options: https://nodejs.org/docs/latest-v10.x/api/child_process.html#child_process_child_process_exec_command_options_c
(cmd, options)
| 479 | * @param {ExecOptions} options, see here for options: https://nodejs.org/docs/latest-v10.x/api/child_process.html#child_process_child_process_exec_command_options_callback |
| 480 | */ |
| 481 | function runCommand(cmd, options) { |
| 482 | return new Promise((resolve, reject) => { |
| 483 | let execError = undefined; |
| 484 | try { |
| 485 | execSync(cmd, { stdio: 'inherit', ...options }); |
| 486 | } catch (err) { |
| 487 | reject(err); |
| 488 | } |
| 489 | resolve(); |
| 490 | }); |
| 491 | } |