From 23e778ab2bad8743dc7e82ae8eff2ce2a8500663 Mon Sep 17 00:00:00 2001 From: BurnyLlama Date: Sun, 7 Nov 2021 20:39:08 +0100 Subject: [PATCH] JUST DELETE FIX UNZIPPINGF! --- libs/download/dowload.js | 10 ++++++---- views/pages/leaderboards.njk | 1 - 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libs/download/dowload.js b/libs/download/dowload.js index e27fe2b..9bdd3f0 100644 --- a/libs/download/dowload.js +++ b/libs/download/dowload.js @@ -35,11 +35,13 @@ export function download(url, target) { 'end', () => resolve(result) ) + } else { + fs.unlink(target, () => { + const file = fs.createWriteStream(target) + data.pipe(file) + }) } - else { - const file = fs.createWriteStream(target) - data.pipe(file) - } + data.on( 'end', () => { diff --git a/views/pages/leaderboards.njk b/views/pages/leaderboards.njk index 1ab45e6..a3516e5 100644 --- a/views/pages/leaderboards.njk +++ b/views/pages/leaderboards.njk @@ -26,7 +26,6 @@

{{ rank.rank }}.

{{ rank.player }}

{{ rank.points }} pts

-

{{ rank.region }} pts

{% endfor %}