Fixed status code when run-android fails (#21012)

Summary:
Fixes #21011
Pull Request resolved: https://github.com/facebook/react-native/pull/21012

Differential Revision: D9721471

Pulled By: hramos

fbshipit-source-id: 91f24c6009bd4f5399cffad960feed7213516145
This commit is contained in:
Kræn Hansen 2018-09-11 12:48:48 -07:00 committed by Facebook Github Bot
parent 6052e97ba7
commit d14922e5c9
1 changed files with 10 additions and 4 deletions

View File

@ -121,7 +121,7 @@ function buildAndRun(args) {
const adbPath = getAdbPath(); const adbPath = getAdbPath();
if (args.deviceId) { if (args.deviceId) {
if (isString(args.deviceId)) { if (isString(args.deviceId)) {
runOnSpecificDevice( return runOnSpecificDevice(
args, args,
cmd, cmd,
packageNameWithSuffix, packageNameWithSuffix,
@ -132,7 +132,13 @@ function buildAndRun(args) {
console.log(chalk.red('Argument missing for parameter --deviceId')); console.log(chalk.red('Argument missing for parameter --deviceId'));
} }
} else { } else {
runOnAllDevices(args, cmd, packageNameWithSuffix, packageName, adbPath); return runOnAllDevices(
args,
cmd,
packageNameWithSuffix,
packageName,
adbPath,
);
} }
} }
@ -305,7 +311,7 @@ function runOnAllDevices(
// stderr is automatically piped from the gradle process, so the user // stderr is automatically piped from the gradle process, so the user
// should see the error already, there is no need to do // should see the error already, there is no need to do
// `console.log(e.stderr)` // `console.log(e.stderr)`
return Promise.reject(); return Promise.reject(e);
} }
const devices = adb.getDevices(); const devices = adb.getDevices();
if (devices && devices.length > 0) { if (devices && devices.length > 0) {
@ -343,7 +349,7 @@ function runOnAllDevices(
// stderr is automatically piped from the gradle process, so the user // stderr is automatically piped from the gradle process, so the user
// should see the error already, there is no need to do // should see the error already, there is no need to do
// `console.log(e.stderr)` // `console.log(e.stderr)`
return Promise.reject(); return Promise.reject(e);
} }
} }
} }