From 52169d61601b68ab23c6d6cdc0c5787673449f58 Mon Sep 17 00:00:00 2001 From: C-3PO Date: Sun, 8 Jul 2018 23:31:14 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=91=20Remove=20various=20debugging=20f?= =?UTF-8?q?eatures?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ssn/extractFileAsStream.ts | 5 ----- src/ssn/getPatch.ts | 8 ++++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/ssn/extractFileAsStream.ts b/src/ssn/extractFileAsStream.ts index 6e8d1bb..6bab925 100644 --- a/src/ssn/extractFileAsStream.ts +++ b/src/ssn/extractFileAsStream.ts @@ -22,11 +22,6 @@ export default async function extractFileAsStream(file: ISsnFileEntry, inputStre await readBytesFromStream(curStream, 12); } - if (skipDecompression) { - const fileStream = fs.createWriteStream(`/tmp/patcher/${file.name}`); - curStream.pipe(fileStream); - } - if (!skipDecompression) { //pipe into decompression const decompressTransform = zlib.createInflateRaw(); diff --git a/src/ssn/getPatch.ts b/src/ssn/getPatch.ts index b535283..1158798 100644 --- a/src/ssn/getPatch.ts +++ b/src/ssn/getPatch.ts @@ -39,8 +39,8 @@ export default async function getPatch(product: Product, from: number, to: numbe fileEntries.filter((file) => file.diffType === SsnDiffType.NewFile).forEach(async (file) => { try { const fileStream = await getFileFromDisks(diskFilenames, { diskStart: file.diskNumberStart, offset: file.offset, length: file.compressedSize }); - const fileContents = await extractFileAsStream(file, fileStream, true); - console.debug(file.name, file.compressedSize); //, await streamToArrayBuffer(fileContents)); + const fileContents = await extractFileAsStream(file, fileStream); + console.debug(file.name, file.compressedSize, await streamToArrayBuffer(fileContents)); //TODO: need to write to disk } catch (error) { console.error(`Could not extract file "${file.name}"`, error); @@ -51,8 +51,8 @@ export default async function getPatch(product: Product, from: number, to: numbe fileEntries.filter((file) => file.diffType === SsnDiffType.Changed).forEach(async (file) => { try { const fileStream = await getFileFromDisks(diskFilenames, { diskStart: file.diskNumberStart, offset: file.offset, length: file.compressedSize }); - const fileContents = await extractFileAsStream(file, fileStream, true); - console.debug(file.name, file.compressedSize); //, await streamToArrayBuffer(fileContents)); + const fileContents = await extractFileAsStream(file, fileStream); + console.debug(file.name, file.compressedSize, await streamToArrayBuffer(fileContents)); //TODO: need to apply diffing, then write to disk } catch (error) { console.error(`Could not extract file "${file.name}"`, error);