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 %}