From c620a9f55e9b559c9df735029a5198e01ad6a8b9 Mon Sep 17 00:00:00 2001 From: C-3PO Date: Thu, 5 Jul 2018 16:42:04 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Add=20debugging=20output?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ssn/extractFileStream.ts | 5 +++++ src/ssn/getManifest.ts | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ssn/extractFileStream.ts b/src/ssn/extractFileStream.ts index 1b4f267..3d01061 100644 --- a/src/ssn/extractFileStream.ts +++ b/src/ssn/extractFileStream.ts @@ -1,5 +1,6 @@ //Similar to extractFile.ts, but instead of receiving and returning an ArrayBuffer, works with Node.js streams. +import * as fs from 'fs'; import * as stream from 'stream'; import * as zlib from 'zlib'; import { ISsnFileEntry } from '../interfaces/ISsnFileEntry'; @@ -43,6 +44,10 @@ export default function extractFileStream(file: ISsnFileEntry, inputStream: stre curStream = curStream.pipe(decryptTransform); } + const writeStream = fs.createWriteStream('test-deflated.raw'); + curStream.pipe(writeStream); + return curStream; + //pipe into decompression const decompressTransform = zlib.createInflateRaw(); decompressTransform.on('error', (error) => { diff --git a/src/ssn/getManifest.ts b/src/ssn/getManifest.ts index e0e1abb..c479e43 100644 --- a/src/ssn/getManifest.ts +++ b/src/ssn/getManifest.ts @@ -37,7 +37,7 @@ export default async function getManifest(product: Product): Promise //Extract manifest.xml file const patchmanifestStream = extractFileStream(firstFile, stream); - //Convert ArrayBuffer to string + /*//Convert ArrayBuffer to string const patchmanifestXml = await streamToString(patchmanifestStream); //convert XML to JSON-converted XML @@ -49,5 +49,6 @@ export default async function getManifest(product: Product): Promise //convert JSON-converted XML to an easier to read JSON const patchManifestSimple = parsePatchmanifest(patchManifestJson); - return patchManifestSimple; + return patchManifestSimple;*/ + return { current: -1, releases: {} }; }