refactor(types): improve vinyl types
test / test (push) Failing after 6m5s

This commit is contained in:
2026-10-27 19:24:54 +03:00
parent fc7f97b520
commit 428f9d100e
5 changed files with 58 additions and 13 deletions
+15 -3
View File
@@ -1,10 +1,22 @@
import async from "async";
import async, { type ErrorCallback } from "async";
import child_process from "child_process";
import { Logger } from "./log";
const log = new Logger("exec");
const queue = async.queue((task: any, done: any) => {
export interface Result {
stdout: string;
stderr: string;
}
interface Task {
dir: string;
command: string;
success: (result: Result) => void;
failure: (error: string) => void;
}
const queue = async.queue((task: Task, done: ErrorCallback) => {
log.d("*%s*", task.command);
//process.chdir(task.dir);
child_process.exec(task.command, { cwd: task.dir, maxBuffer: 1024 * 10000 }, (err, stdout, stderr) => {
@@ -19,7 +31,7 @@ const queue = async.queue((task: any, done: any) => {
});
});
export default (dir: string, command: string) => {
export default (dir: string, command: string): Promise<Result> => {
return new Promise((success, failure) => {
queue.push({
dir: dir,
+2 -1
View File
@@ -15,7 +15,8 @@ class BufferingTransform extends Transform {
callback();
}
}
export class TailVinyl extends Vinyl {
export class TailVinyl extends Vinyl<BufferingTransform> {
private tail?: Tail;
constructor(params: WatchParams) {