Skip to content

Commit 7031290

Browse files
author
John Haley
committed
Confirm builder exists before building
When not using Node 0.10.x we would sometimes have a missing builder (i.e. pangyp or nw-gyp). We'll now do an `npm install` for whatever builder we're using to make sure it exists.
1 parent 78ea2c5 commit 7031290

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lifecycleScripts/install.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,15 @@ function build() {
108108
target = "--target=" + nwVersion;
109109
}
110110

111-
builder = path.resolve(".", "node_modules", ".bin", builder);
112-
builder = builder.replace(/\s/g, "\\$&");
113-
var cmd = [prefix, builder, "rebuild", target, debug, distUrl]
114-
.join(" ").trim();
111+
return exec("npm install " + builder)
112+
.then(function() {
113+
builder = path.resolve(".", "node_modules", ".bin", builder);
114+
builder = builder.replace(/\s/g, "\\$&");
115+
var cmd = [prefix, builder, "rebuild", target, debug, distUrl]
116+
.join(" ").trim();
115117

116-
return exec(cmd, opts)
118+
return exec(cmd, opts);
119+
})
117120
.then(function() {
118121
console.info("[nodegit] Compilation complete.");
119122
console.info("[nodegit] Completed installation successfully.");

0 commit comments

Comments
 (0)