Skip to content

Commit 444cf45

Browse files
committed
fix http_parser in v10
1 parent 7f5fe78 commit 444cf45

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

lifecycleScripts/checkPrepared.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ var fs = require("fs");
44
var rooted = path.join.bind(path, __dirname, "..");
55
var pkg = require(rooted("package"));
66

7+
var NODE_VERSION = Number(process.version.match(/^v(\d+\.\d+)/)[1]);
8+
79
module.exports.checkAll = function checkAll() {
810
return Promise.all([
911
checkVendor("libgit2"),
@@ -31,7 +33,15 @@ function checkExists(name) {
3133
module.exports.checkExists = checkExists;
3234

3335
function checkVendor(name, skipVersion) {
34-
var version = skipVersion ? "" : (pkg[name].sha || pkg[name].version);
36+
var version = "";
37+
if (!skipVersion) {
38+
var vendorPackage = pkg[name];
39+
if (NODE_VERSION === 0.1 && vendorPackage["0.10"]) {
40+
vendorPackage = vendorPackage["0.10"];
41+
}
42+
version = vendorPackage.sha || vendorPackage.version;
43+
}
44+
3545
var vendorPath = "vendor/" + name + "/" + version;
3646
return checkExists(vendorPath);
3747
}

lifecycleScripts/install.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ var exec = promisify(function(command, opts, callback) {
1515
return require("child_process").exec(command, opts, callback);
1616
});
1717

18-
19-
forNodeWebkit(local(".."))
18+
return forNodeWebkit(local(".."))
2019
.then(function(results) {
2120
return results.nwVersion;
2221
})
@@ -41,14 +40,13 @@ forNodeWebkit(local(".."))
4140
.then(
4241
function() {
4342
console.info("[nodegit] Completed installation successfully.");
44-
return Promise.done();
4543
},
4644
function() {
4745
console.info("[nodegit] Failed to install prebuilt binary, building manually.");
4846
return checkAndBuild();
4947
}
5048
);
51-
})
49+
});
5250

5351

5452
function checkAndBuild(nwVersion) {

lifecycleScripts/retrieveExternalDependencies.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ var pkg = require(rooted("package"));
1313
var tar;
1414
var request;
1515

16+
var NODE_VERSION = Number(process.version.match(/^v(\d+\.\d+)/)[1]);
17+
1618
module.exports = function retrieveExternalDependencies() {
1719
tar = require("tar");
1820
request = require("request");
@@ -26,7 +28,12 @@ module.exports = function retrieveExternalDependencies() {
2628

2729
function getVendorLib(name, url) {
2830
var vendorPath = "vendor/" + name + "/";
29-
var version = pkg[name].sha || pkg[name].version;
31+
var vendorPackage = pkg[name];
32+
if (NODE_VERSION === 0.1 && vendorPackage["0.10"]) {
33+
vendorPackage = vendorPackage["0.10"];
34+
}
35+
36+
var version = vendorPackage.sha || vendorPackage.version;
3037

3138
console.info("[nodegit] Detecting " + vendorPath + ".");
3239
return check(name)

0 commit comments

Comments
 (0)