Skip to content

Commit d14922e

Browse files
kraenhansenfacebook-github-bot
authored andcommitted
Fixed status code when run-android fails (facebook#21012)
Summary: Fixes facebook#21011 Pull Request resolved: facebook#21012 Differential Revision: D9721471 Pulled By: hramos fbshipit-source-id: 91f24c6009bd4f5399cffad960feed7213516145
1 parent 6052e97 commit d14922e

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

local-cli/runAndroid/runAndroid.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function buildAndRun(args) {
121121
const adbPath = getAdbPath();
122122
if (args.deviceId) {
123123
if (isString(args.deviceId)) {
124-
runOnSpecificDevice(
124+
return runOnSpecificDevice(
125125
args,
126126
cmd,
127127
packageNameWithSuffix,
@@ -132,7 +132,13 @@ function buildAndRun(args) {
132132
console.log(chalk.red('Argument missing for parameter --deviceId'));
133133
}
134134
} else {
135-
runOnAllDevices(args, cmd, packageNameWithSuffix, packageName, adbPath);
135+
return runOnAllDevices(
136+
args,
137+
cmd,
138+
packageNameWithSuffix,
139+
packageName,
140+
adbPath,
141+
);
136142
}
137143
}
138144

@@ -305,7 +311,7 @@ function runOnAllDevices(
305311
// stderr is automatically piped from the gradle process, so the user
306312
// should see the error already, there is no need to do
307313
// `console.log(e.stderr)`
308-
return Promise.reject();
314+
return Promise.reject(e);
309315
}
310316
const devices = adb.getDevices();
311317
if (devices && devices.length > 0) {
@@ -343,7 +349,7 @@ function runOnAllDevices(
343349
// stderr is automatically piped from the gradle process, so the user
344350
// should see the error already, there is no need to do
345351
// `console.log(e.stderr)`
346-
return Promise.reject();
352+
return Promise.reject(e);
347353
}
348354
}
349355
}

0 commit comments

Comments
 (0)