diff --git a/react-native-git-upgrade/cliEntry.js b/react-native-git-upgrade/cliEntry.js index 11542a946e9892..ab83c1f5993b4a 100644 --- a/react-native-git-upgrade/cliEntry.js +++ b/react-native-git-upgrade/cliEntry.js @@ -52,12 +52,18 @@ function exec(command, logOutput) { process.stderr.write(data); }); - child.on('exit', code => { - (code === 0) - ? resolve(stdout) - : reject(new Error(`Command '${command}' exited with code ${code}: + child.on('exit', (code, signal) => { + if (code === 0) { + resolve(stdout); + } else if (code) { + reject(new Error(`Command '${command}' exited with code ${code}: stderr: ${stderr} stdout: ${stdout}`)); + } else { + reject(new Error(`Command '${command}' terminated with signal '${signal}': +stderr: ${stderr} +stdout: ${stdout}`)); + } }); }); }