Skip to content

Commit 8afa0e5

Browse files
committed
Updated installer
1 parent d08120f commit 8afa0e5

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

install.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,21 @@ var updateSubmodules = function(mainCallback) {
4646

4747
var checkoutDependencies = function(mainCallback) {
4848
console.log('[nodegit] Downloading libgit2 dependency.');
49-
5049
var commit = 'b70bf922a1de35722904930c42467e95c889562f';
5150
var libgit2ZipUrl = 'https://github.com/libgit2/libgit2/archive/' + commit + '.zip';
5251
zipFile = __dirname + '/vendor/libgit2.zip',
5352
unzippedFolderName = __dirname + '/vendor/libgit2-' + commit,
5453
targetFolderName = __dirname + '/vendor/libgit2';
5554

56-
async.series([
57-
function(callback) {
58-
request(libgit2ZipUrl)
59-
.pipe(fs.createWriteStream(zipFile))
60-
.on('close', function () {
61-
callback();
55+
async.waterfall([
56+
function downloadLibgit2(callback) {
57+
var ws = fs.createWriteStream(zipFile);
58+
ws.on('close', function() {
59+
callback();
6260
});
63-
64-
}, function(callback) {
61+
request(libgit2ZipUrl)
62+
.pipe(ws);
63+
}, function unzipLibgit2(callback) {
6564
var zip = new AdmZip(zipFile);
6665
zip.extractAllTo(__dirname + '/vendor/', true);
6766
fs.unlink(zipFile);

0 commit comments

Comments
 (0)