From d14922e5c98558fb1f144fce7ab4dd4cb7978af0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Tue, 11 Sep 2018 12:48:48 -0700 Subject: [PATCH] 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 --- local-cli/runAndroid/runAndroid.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/local-cli/runAndroid/runAndroid.js b/local-cli/runAndroid/runAndroid.js index 2bb7dd744..0ab849eef 100644 --- a/local-cli/runAndroid/runAndroid.js +++ b/local-cli/runAndroid/runAndroid.js @@ -121,7 +121,7 @@ function buildAndRun(args) { const adbPath = getAdbPath(); if (args.deviceId) { if (isString(args.deviceId)) { - runOnSpecificDevice( + return runOnSpecificDevice( args, cmd, packageNameWithSuffix, @@ -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, + ); } } @@ -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) { @@ -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); } } }