From 59ffb39d8a14fa825669ba221e78b3cee5447afd Mon Sep 17 00:00:00 2001 From: C-3PO Date: Fri, 14 Sep 2018 04:44:44 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Add=20debugging=20message?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cdn/downloadUrlContents.ts | 1 + src/ssn/getPatch.ts | 4 ++-- src/ssn/patcher-installer/launch.ts | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/cdn/downloadUrlContents.ts b/src/cdn/downloadUrlContents.ts index efe910a..adc0515 100644 --- a/src/cdn/downloadUrlContents.ts +++ b/src/cdn/downloadUrlContents.ts @@ -16,6 +16,7 @@ export default function downloadUrlContents({ host, path, size }: {host: string, const folderName = nodePath.dirname(tempFileName); createDirRecursively(folderName).then(() => { //Check if file already exists locally + console.log('Checking local cache...', tempFileName, size); checkLocalCache(tempFileName, size).then((cacheStatus) => { if (cacheStatus) { return resolve(tempFileName); diff --git a/src/ssn/getPatch.ts b/src/ssn/getPatch.ts index 6724e3a..f630127 100644 --- a/src/ssn/getPatch.ts +++ b/src/ssn/getPatch.ts @@ -135,7 +135,7 @@ export default async function getPatch({ product, from, to, sourceDirectory, tar }); //Need to delete deleted files - if (sourceDirectory === targetDirectory) { + if (sourceDir === targetDir) { fileEntries.filter((file) => file.diffType === SsnDiffType.Deleted).forEach((file) => { //delete file const fileName = path.join(targetDir, file.name); @@ -149,7 +149,7 @@ export default async function getPatch({ product, from, to, sourceDirectory, tar } //Need to copy unchanged files (if we are patching into a different directory) - if (sourceDirectory !== targetDirectory) { + if (sourceDir !== targetDir) { fileEntries.filter((file) => file.diffType === SsnDiffType.Unchanged).forEach(async (file) => { //copy file const sourceName = path.join(sourceDir, file.name); diff --git a/src/ssn/patcher-installer/launch.ts b/src/ssn/patcher-installer/launch.ts index 9aab5f3..56177dc 100644 --- a/src/ssn/patcher-installer/launch.ts +++ b/src/ssn/patcher-installer/launch.ts @@ -31,6 +31,8 @@ export default function launchProcess( spawnedProcess.stdout.on('end', resolve); spawnedProcess.stderr.setEncoding('utf8'); - spawnedProcess.stderr.on('data', reject); + spawnedProcess.stderr.on('data', (error) => { + reject(`Error in process:\n> ${processPath} ${parameters.join('v')}\nerror`); + }); }); }