From 77ff039406e56ec90266439b2df69849f671108d Mon Sep 17 00:00:00 2001 From: Kuba Orlik Date: Sat, 3 Apr 2021 19:25:44 +0200 Subject: [PATCH] Fix spawn not resolving --- src/index.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index c8ab59e..5e76004 100644 --- a/src/index.ts +++ b/src/index.ts @@ -33,14 +33,11 @@ export class DeferedSpawn extends Emittery { } async waitForNextData(): Promise { - console.log("waiting for next data from", this.process.spawnargs.join(" ")); return new Promise((resolve, reject) => { this.on("data", (data) => { - console.log("got answer from process", this.process.spawnfile); resolve(data.toString("utf-8")); }); this.on("error", (err) => { - console.error("Rejecting from process", this.process.spawnfile, err); reject(err); }); this.on("end", () => resolve(null)); @@ -83,13 +80,13 @@ export function deferedSpawn( err += data.toString("utf-8"); }); process.on("spawn", () => { + spawned = true; resolve(emitter); }); process.on("close", (code) => { if (!spawned) { reject(err); } else { - console.log("!!!!!!!!!!!!!!!!!!!! PROCESS CLOSED"); if (code === 0) { emitter.emit("success", output); } else {