refactor: refork tail module

This commit is contained in:
2026-10-22 12:04:40 +03:00
parent a421d56ec1
commit 84d905dbb3
12 changed files with 1047 additions and 2036 deletions
+5 -14
View File
@@ -1,9 +1,8 @@
import os from "os";
import path from "path";
import through from "through2";
import { Env } from "../common/env";
import { System } from "../common/system";
import { TailVinyl } from "../common/tail";
import { watch } from "../common/watch";
import run from "../run";
import { FlashPlayer } from "./flashplayer";
@@ -55,18 +54,10 @@ export class RufflePlayer extends FlashPlayer {
return run(`${this.flashPlayerBin} ${filename}`, params)
.exec()
.pipe(
through.obj(function (file: any, enc: string, callback: any) {
const log = new TailVinyl({
path: RufflePlayer.log,
handler: (line: string) => {
if (line.includes("avm_trace")) {
return line.split("avm_trace: ").pop();
}
},
});
this.on("end", () => log.dispose());
this.push(log);
callback();
watch(RufflePlayer.log, (line: string) => {
if (line.includes("avm_trace")) {
return line.split("avm_trace: ").pop();
}
}),
);
}