This is an automated email from the ASF dual-hosted git repository.

erisu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-android.git


The following commit(s) were added to refs/heads/master by this push:
     new 0924654  fix (adb): shell to return expected stdout (#904)
0924654 is described below

commit 0924654a479a2ac60425ccfd8ae75e82bc2750a9
Author: エリス <[email protected]>
AuthorDate: Tue Jan 21 23:37:22 2020 +0900

    fix (adb): shell to return expected stdout (#904)
---
 bin/templates/cordova/lib/Adb.js | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/bin/templates/cordova/lib/Adb.js b/bin/templates/cordova/lib/Adb.js
index 965b4f3..042a0c2 100644
--- a/bin/templates/cordova/lib/Adb.js
+++ b/bin/templates/cordova/lib/Adb.js
@@ -83,10 +83,9 @@ Adb.shell = function (target, shellCommand) {
     events.emit('verbose', 'Running adb shell command "' + shellCommand + '" 
on target ' + target + '...');
     var args = ['-s', target, 'shell'];
     shellCommand = shellCommand.split(/\s+/);
-    return execa('adb', args.concat(shellCommand), { cwd: os.tmpdir() 
}).catch((error) => {
-        return Promise.reject(new CordovaError('Failed to execute shell 
command "' +
-            shellCommand + '"" on device: ' + error));
-    });
+    return execa('adb', args.concat(shellCommand), { cwd: os.tmpdir() })
+        .then(({ stdout }) => stdout)
+        .catch(error => Promise.reject(new CordovaError(`Failed to execute 
shell command "${shellCommand}" on device: ${error}`)));
 };
 
 Adb.start = function (target, activityName) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to