From 0c28d1bfb2ff066a9aaf67738ba895f7d210adba Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 21 Feb 2020 18:25:33 +0000 Subject: [PATCH] Use needle consistently and remove unused variable --- scripts/fetch-package.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/scripts/fetch-package.js b/scripts/fetch-package.js index 9462d98..c0b2cf6 100755 --- a/scripts/fetch-package.js +++ b/scripts/fetch-package.js @@ -81,7 +81,7 @@ async function downloadToFile(url, filename) { console.log("Downloading " + url + "..."); try { - const bob = await needle('get', url, null, + await needle('get', url, null, { follow_max: 5, output: filename, @@ -184,14 +184,7 @@ async function main() { } resolve(!error); }); - https.get(PUB_KEY_URL, (resp) => { - resp.on('data', (chunk) => { - gpgProc.stdin.write(chunk); - }); - resp.on('end', (chunk) => { - gpgProc.stdin.end(); - }); - }); + needle.get(PUB_KEY_URL).pipe(gpgProc.stdin); }); return 0; }