🗑 Remove various debugging features

This commit is contained in:
C-3PO 2018-07-08 23:31:14 +02:00
parent eb8366abdc
commit 52169d6160
Signed by: c3po
GPG key ID: 62993C4BB4D86F24
2 changed files with 4 additions and 9 deletions

View file

@ -22,11 +22,6 @@ export default async function extractFileAsStream(file: ISsnFileEntry, inputStre
await readBytesFromStream(curStream, 12); await readBytesFromStream(curStream, 12);
} }
if (skipDecompression) {
const fileStream = fs.createWriteStream(`/tmp/patcher/${file.name}`);
curStream.pipe(fileStream);
}
if (!skipDecompression) { if (!skipDecompression) {
//pipe into decompression //pipe into decompression
const decompressTransform = zlib.createInflateRaw(); const decompressTransform = zlib.createInflateRaw();

View file

@ -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) => { fileEntries.filter((file) => file.diffType === SsnDiffType.NewFile).forEach(async (file) => {
try { try {
const fileStream = await getFileFromDisks(diskFilenames, { diskStart: file.diskNumberStart, offset: file.offset, length: file.compressedSize }); const fileStream = await getFileFromDisks(diskFilenames, { diskStart: file.diskNumberStart, offset: file.offset, length: file.compressedSize });
const fileContents = await extractFileAsStream(file, fileStream, true); const fileContents = await extractFileAsStream(file, fileStream);
console.debug(file.name, file.compressedSize); //, await streamToArrayBuffer(fileContents)); console.debug(file.name, file.compressedSize, await streamToArrayBuffer(fileContents));
//TODO: need to write to disk //TODO: need to write to disk
} catch (error) { } catch (error) {
console.error(`Could not extract file "${file.name}"`, 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) => { fileEntries.filter((file) => file.diffType === SsnDiffType.Changed).forEach(async (file) => {
try { try {
const fileStream = await getFileFromDisks(diskFilenames, { diskStart: file.diskNumberStart, offset: file.offset, length: file.compressedSize }); const fileStream = await getFileFromDisks(diskFilenames, { diskStart: file.diskNumberStart, offset: file.offset, length: file.compressedSize });
const fileContents = await extractFileAsStream(file, fileStream, true); const fileContents = await extractFileAsStream(file, fileStream);
console.debug(file.name, file.compressedSize); //, await streamToArrayBuffer(fileContents)); console.debug(file.name, file.compressedSize, await streamToArrayBuffer(fileContents));
//TODO: need to apply diffing, then write to disk //TODO: need to apply diffing, then write to disk
} catch (error) { } catch (error) {
console.error(`Could not extract file "${file.name}"`, error); console.error(`Could not extract file "${file.name}"`, error);