🗑 Remove various debugging features
This commit is contained in:
parent
eb8366abdc
commit
52169d6160
2 changed files with 4 additions and 9 deletions
|
@ -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();
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue