mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-31 09:02:50 +08:00
fix (adb): shell to return expected stdout (#904)
This commit is contained in:
parent
8ef742e79d
commit
0924654a47
7
bin/templates/cordova/lib/Adb.js
vendored
7
bin/templates/cordova/lib/Adb.js
vendored
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user