Skip to content

Commit

Permalink
fix bug: "end" event sent before file created when download
Browse files Browse the repository at this point in the history
  • Loading branch information
wuchengwei committed Nov 27, 2012
1 parent de062ed commit ee0cbec
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/wget.js
Expand Up @@ -48,6 +48,8 @@ function download(src, output, options) {
});
res.on('end', function() {
writeStream.end();
});
writeStream.on('close', function(){
downloader.emit('end', output);
});
} else {
Expand Down

0 comments on commit ee0cbec

Please sign in to comment.