feat(bin): use cmd in settings

This commit is contained in:
Simon Chan 2023-06-22 19:55:45 +08:00
parent 9b0e06cdfb
commit e3bfd1592f
No known key found for this signature in database
GPG key ID: A8B69F750B9BCEDD
8 changed files with 1490 additions and 1495 deletions

View file

@ -108,15 +108,15 @@ export class AdbSubprocess extends AdbCommandBase {
command: string | string[],
options?: Partial<AdbSubprocessOptions>
): Promise<AdbSubprocessWaitResult> {
const shell = await this.spawn(command, options);
const process = await this.spawn(command, options);
const stdout = new GatherStringStream();
const stderr = new GatherStringStream();
const [, , exitCode] = await Promise.all([
shell.stdout.pipeThrough(new DecodeUtf8Stream()).pipeTo(stdout),
shell.stderr.pipeThrough(new DecodeUtf8Stream()).pipeTo(stderr),
shell.exit,
process.stdout.pipeThrough(new DecodeUtf8Stream()).pipeTo(stdout),
process.stderr.pipeThrough(new DecodeUtf8Stream()).pipeTo(stderr),
process.exit,
]);
return {