Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPII-4171: Initial implementation of gpii-windows-installer #1

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
GPII-4171: Wait for the pipe close event to consider the file downloaded
javihernandez committed Apr 7, 2020

Verified

This commit was signed with the committer’s verified signature.
Keith-CY Chen Yu
commit 900b9dd3bdf566222854e8ec3dc28caf9d095144
8 changes: 6 additions & 2 deletions src/artifacts.js
Original file line number Diff line number Diff line change
@@ -111,7 +111,7 @@ gpii.installer.artifact.download = function (downloadUrl, defaultOutputPath, out

fluid.log("Downloading ", downloadUrl);

req.pipe(outStream);
var pipe = req.pipe(outStream);

req.on("error", function (err) {
var err = "Couldn't download artifact, error was: " + err;
@@ -124,7 +124,11 @@ gpii.installer.artifact.download = function (downloadUrl, defaultOutputPath, out
req.on("end", function () {
outStream.close();
outStream = null;
event.fire(outputFile);
// This way we avoid the 'End-of-central-directory signature not found'
// error that sometimes we get.
pipe.on("close", function () {
event.fire(outputFile);
});
});
};