mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-04 10:19:17 +02:00
fix(stream): re-export global TextDecoder
stream instead of implementing our own one which doesn't work correctly in stream mode
This commit is contained in:
parent
7bb1063a12
commit
edf532caf4
14 changed files with 78 additions and 42 deletions
|
@ -8,8 +8,8 @@ import { AdbCommandBase, escapeArg } from "@yume-chan/adb";
|
|||
import type { MaybeConsumable, ReadableStream } from "@yume-chan/stream-extra";
|
||||
import {
|
||||
ConcatStringStream,
|
||||
DecodeUtf8Stream,
|
||||
SplitStringStream,
|
||||
TextDecoderStream,
|
||||
} from "@yume-chan/stream-extra";
|
||||
|
||||
import { Cmd } from "./cmd.js";
|
||||
|
@ -352,7 +352,7 @@ export class PackageManager extends AdbCommandBase {
|
|||
const process = await this.#cmd.spawn(false, "package", ...args);
|
||||
|
||||
const output = process.stdout
|
||||
.pipeThrough(new DecodeUtf8Stream())
|
||||
.pipeThrough(new TextDecoderStream())
|
||||
.pipeThrough(new ConcatStringStream())
|
||||
.then((output) => output.trim());
|
||||
|
||||
|
@ -440,7 +440,7 @@ export class PackageManager extends AdbCommandBase {
|
|||
|
||||
const process = await this.#cmdOrSubprocess(args);
|
||||
const reader = process.stdout
|
||||
.pipeThrough(new DecodeUtf8Stream())
|
||||
.pipeThrough(new TextDecoderStream())
|
||||
.pipeThrough(new SplitStringStream("\n"))
|
||||
.getReader();
|
||||
while (true) {
|
||||
|
@ -468,7 +468,7 @@ export class PackageManager extends AdbCommandBase {
|
|||
|
||||
const process = await this.#cmdOrSubprocess(args);
|
||||
const output = await process.stdout
|
||||
.pipeThrough(new DecodeUtf8Stream())
|
||||
.pipeThrough(new TextDecoderStream())
|
||||
.pipeThrough(new ConcatStringStream())
|
||||
.then((output) => output.trim());
|
||||
if (output !== "Success") {
|
||||
|
@ -489,7 +489,7 @@ export class PackageManager extends AdbCommandBase {
|
|||
|
||||
const process = await this.#cmdOrSubprocess(args);
|
||||
const output = await process.stdout
|
||||
.pipeThrough(new DecodeUtf8Stream())
|
||||
.pipeThrough(new TextDecoderStream())
|
||||
.pipeThrough(new ConcatStringStream())
|
||||
.then((output) => output.trim());
|
||||
|
||||
|
@ -515,7 +515,7 @@ export class PackageManager extends AdbCommandBase {
|
|||
|
||||
const process = await this.#cmdOrSubprocess(args);
|
||||
const output = await process.stdout
|
||||
.pipeThrough(new DecodeUtf8Stream())
|
||||
.pipeThrough(new TextDecoderStream())
|
||||
.pipeThrough(new ConcatStringStream())
|
||||
.then((output) => output.trim());
|
||||
|
||||
|
@ -562,7 +562,7 @@ export class PackageManager extends AdbCommandBase {
|
|||
|
||||
const process = await this.#cmdOrSubprocess(args);
|
||||
const output = process.stdout
|
||||
.pipeThrough(new DecodeUtf8Stream())
|
||||
.pipeThrough(new TextDecoderStream())
|
||||
.pipeThrough(new ConcatStringStream())
|
||||
.then((output) => output.trim());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue