From c348e318ce6e9a1d67febe40003aeb6badedea8f Mon Sep 17 00:00:00 2001 From: Elliott Kember Date: Tue, 16 Feb 2021 09:55:18 -0800 Subject: [PATCH] Add "open" guard for AsarUtil to fix concurrent builds (#5567) * Add "open" guard for AsarUtil to fix concurrent builds (#5567) * Remove file-streaming optimization for M1 * Restore original code, with open event handler guard --- packages/app-builder-lib/src/asar/asarUtil.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/app-builder-lib/src/asar/asarUtil.ts b/packages/app-builder-lib/src/asar/asarUtil.ts index 844d6c0af9f..04fb6af6ecc 100644 --- a/packages/app-builder-lib/src/asar/asarUtil.ts +++ b/packages/app-builder-lib/src/asar/asarUtil.ts @@ -209,8 +209,10 @@ export class AsarPackager { const readStream = createReadStream(file) readStream.on("error", reject) readStream.once("end", () => w(index + 1)) - readStream.pipe(writeStream, { - end: false + readStream.on("open", () => { + readStream.pipe(writeStream, { + end: false + }) }) } }