From a039094e93a427ef9a768eb5f712a8d5ba423262 Mon Sep 17 00:00:00 2001
From: eric sciple <ericsciple@users.noreply.github.com>
Date: Tue, 10 Dec 2019 01:40:30 -0500
Subject: [PATCH] .

---
 dist/index.js            | 7 ++++---
 src/github-api-helper.ts | 7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/dist/index.js b/dist/index.js
index 1e85281..6e44887 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -8464,15 +8464,16 @@ function downloadFile(url, fileStream) {
                     response.resume(); // Consume response data to free up memory
                     return;
                 }
-                response.on('data', chunk => {
-                    fileStream.write(chunk);
-                });
+                // response.on('data', chunk => {
+                //   fileStream.write(chunk)
+                // })
                 response.on('end', () => {
                     resolve();
                 });
                 response.on('error', err => {
                     reject(err);
                 });
+                response.pipe(fileStream);
             });
         }
         catch (err) {
diff --git a/src/github-api-helper.ts b/src/github-api-helper.ts
index 12ab8e1..b20d863 100644
--- a/src/github-api-helper.ts
+++ b/src/github-api-helper.ts
@@ -142,15 +142,16 @@ function downloadFile(url: string, fileStream: WriteStream): Promise<void> {
           return
         }
 
-        response.on('data', chunk => {
-          fileStream.write(chunk)
-        })
+        // response.on('data', chunk => {
+        //   fileStream.write(chunk)
+        // })
         response.on('end', () => {
           resolve()
         })
         response.on('error', err => {
           reject(err)
         })
+        response.pipe(fileStream)
       })
     } catch (err) {
       reject(err)