Skip to content

Commit 20ca86f

Browse files
committed
overhaul the rest of the build process
includes cleaning of npm registry based installs and a new debug build
1 parent 65cb8b8 commit 20ca86f

9 files changed

Lines changed: 463 additions & 272 deletions

File tree

.didntcomefromthenpmregistry

Whitespace-only changes.

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
.jshintrc
1313
.travis.yml
1414
.appveyor.yml
15+
.didntcomefromthenpmregistry
1516

1617
*.vcxproj
1718
*.filters

install.js

Lines changed: 0 additions & 270 deletions
This file was deleted.

lifecycleScripts/checkPrepared.js

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
var Promise = require("nodegit-promise");
2+
var path = require("path");
3+
var fs = require("fs");
4+
var rooted = path.join.bind(path, __dirname, "..");
5+
var pkg = require(rooted("package"));
6+
7+
module.exports.checkAll = function checkAll() {
8+
return Promise.all([
9+
checkVendor("libgit2"),
10+
checkVendor("libssh2"),
11+
checkVendor("http_parser"),
12+
13+
checkExists("lib/nodegit.js"),
14+
checkExists("lib/enums.js"),
15+
checkExists("src"),
16+
checkExists("include")
17+
]).then(function(checks) {
18+
return checks.reduce(function(soFar, currentCheck) {
19+
return soFar && currentCheck;
20+
}, true);
21+
});
22+
};
23+
24+
function checkExists(name) {
25+
return new Promise(function(resolve, reject) {
26+
fs.exists(rooted(name), function(exists) {
27+
resolve(exists);
28+
});
29+
});
30+
}
31+
module.exports.checkExists = checkExists;
32+
33+
function checkVendor(name, skipVersion) {
34+
var version = skipVersion ? "" : (pkg[name].sha || pkg[name].version);
35+
var vendorPath = "vendor/" + name + "/" + version;
36+
return checkExists(vendorPath);
37+
}
38+
module.exports.checkVendor = checkVendor
39+
40+
function checkGenerated() {
41+
return Promise.all([
42+
checkExists("lib/nodegit.js"),
43+
checkExists("lib/enums.js"),
44+
checkExists("src"),
45+
checkExists("include")
46+
]).then(function(checks) {
47+
return checks.reduce(function(soFar, currentCheck) {
48+
return soFar && currentCheck;
49+
}, true);
50+
});
51+
}
52+
module.exports.checkGenerated = checkGenerated;
53+
54+
// Called on the command line
55+
if (require.main === module) {
56+
module.exports.checkAll();
57+
}

0 commit comments

Comments
 (0)