From d03355c61a199c280333cb118416e009187f1b22 Mon Sep 17 00:00:00 2001 From: C-3PO Date: Thu, 5 Jul 2018 15:32:05 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Fix=20sourcemaps=20to=20include?= =?UTF-8?q?=20ts=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cdn/funcs/saveResponse.ts | 6 ++++++ tsconfig.json | 1 + 2 files changed, 7 insertions(+) diff --git a/src/cdn/funcs/saveResponse.ts b/src/cdn/funcs/saveResponse.ts index 24b0432..31da4ab 100644 --- a/src/cdn/funcs/saveResponse.ts +++ b/src/cdn/funcs/saveResponse.ts @@ -14,6 +14,12 @@ export default function saveResponse( //Remember file size const headerLength = Number(response.headers['content-length']); + //TODO: replace by fs.mkdtemp. Also, file name should be decided in downloadUrlContents(), not here, and we must return a ReadableStream instead of the file name, and automatically delete the file + /*fs.mkdtemp(path.join(os.tmpdir(), 'foo-'), (err, folder) => { + if (err) throw err; + console.log(folder); + // Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2 + });*/ const tempFileName = `/tmp/swtor-patcher-download-${Math.random()}.tmp`; //If we receive a part of the response, write it to disk diff --git a/tsconfig.json b/tsconfig.json index 3ab5f06..cc1e4c4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "baseUrl": ".", "inlineSourceMap": true, + "inlineSources": true, "module": "commonjs", "moduleResolution": "node", "newLine": "lf",