Skip to content

Commit

Permalink
Fixed status code when run-android fails (#21012)
Browse files Browse the repository at this point in the history
Summary:
Fixes #21011
Pull Request resolved: #21012

Differential Revision: D9721471

Pulled By: hramos

fbshipit-source-id: 91f24c6009bd4f5399cffad960feed7213516145
  • Loading branch information
kraenhansen authored and facebook-github-bot committed Sep 11, 2018
1 parent 6052e97 commit d14922e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions local-cli/runAndroid/runAndroid.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function buildAndRun(args) {
const adbPath = getAdbPath();
if (args.deviceId) {
if (isString(args.deviceId)) {
runOnSpecificDevice(
return runOnSpecificDevice(
args,
cmd,
packageNameWithSuffix,
Expand All @@ -132,7 +132,13 @@ function buildAndRun(args) {
console.log(chalk.red('Argument missing for parameter --deviceId'));
}
} else {
runOnAllDevices(args, cmd, packageNameWithSuffix, packageName, adbPath);
return runOnAllDevices(
args,
cmd,
packageNameWithSuffix,
packageName,
adbPath,
);
}
}

Expand Down Expand Up @@ -305,7 +311,7 @@ function runOnAllDevices(
// stderr is automatically piped from the gradle process, so the user
// should see the error already, there is no need to do
// `console.log(e.stderr)`
return Promise.reject();
return Promise.reject(e);
}
const devices = adb.getDevices();
if (devices && devices.length > 0) {
Expand Down Expand Up @@ -343,7 +349,7 @@ function runOnAllDevices(
// stderr is automatically piped from the gradle process, so the user
// should see the error already, there is no need to do
// `console.log(e.stderr)`
return Promise.reject();
return Promise.reject(e);
}
}
}
Expand Down

0 comments on commit d14922e

Please sign in to comment.