-
Notifications
You must be signed in to change notification settings - Fork 696
Expand file tree
/
Copy pathindex.js
More file actions
38 lines (34 loc) · 1.13 KB
/
index.js
File metadata and controls
38 lines (34 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var generateJson = require("./scripts/generateJson");
var generateNativeCode = require("./scripts/generateNativeCode");
var generateMissingTests = require("./scripts/generateMissingTests");
var submoduleStatus = require("../lifecycleScripts/submodules/getStatus");
module.exports = function generate() {
console.log("[nodegit] Generating native code");
return submoduleStatus()
.then(function(statuses) {
var dirtySubmodules = statuses
.filter(function(status) {
return status.onNewCommit
|| status.needsInitialization
|| status.workDirDirty;
});
if (dirtySubmodules.length) {
console.warn("[nodegit] WARNING - Some submodules are out-of-sync");
dirtySubmodules.forEach(function(submodule) {
console.warn("[nodegit]\t" + submodule.name);
});
}
})
.then(function() {
generateJson();
generateNativeCode();
generateMissingTests();
})
.catch(function(e) {
console.error("[nodegit] ERROR - Could not generate native code");
console.error(e);
});
}
if (require.main === module) {
module.exports();
}