* Executes the provided command, piping the parent process' stderr, throwing * an error with the provided message the command fails, and returns the * process object. * @param {string} cmd * @param {string} msg * @return {!Object}
(cmd, msg)
| 73 | * @return {!Object} |
| 74 | */ |
| 75 | function execOrThrow(cmd, msg) { |
| 76 | const p = exec(cmd, {'stdio': ['inherit', 'inherit', 'pipe']}); |
| 77 | if (p.status && p.status != 0) { |
| 78 | log(red('ERROR:'), msg); |
| 79 | const error = new Error(p.stderr); |
| 80 | error.status = p.status; |
| 81 | throw error; |
| 82 | } |
| 83 | return p; |
| 84 | } |
| 85 | |
| 86 | module.exports = { |
| 87 | exec, |
no test coverage detected