🚧 manually decompress file to debug

This commit is contained in:
C-3PO 2018-07-08 22:59:31 +02:00
parent 864b6dc6f6
commit a07d719d4f
Signed by: c3po
GPG key ID: 62993C4BB4D86F24

14
src/inflateFile.ts Normal file
View file

@ -0,0 +1,14 @@
import * as fs from 'fs';
import * as zlib from 'zlib';
const fileReadStream = fs.createReadStream('/tmp/patcher/Assets/swtor_de-de_area_raid_1.tor');
const decompressTransform = zlib.createInflateRaw();
decompressTransform.on('error', (error) => {
//TODO: need to throw error sync, not async
throw new Error(`Error during decompression: ${error.message}`);
});
const fileWriteStream = fs.createWriteStream('/tmp/patcher/Assets/swtor_de-de_area_raid_1.tor.raw');
fileReadStream.pipe(decompressTransform).pipe(fileWriteStream);