Skip to content

Commit a185685

Browse files
committed
Parse some args for node-pre-gyp.
1 parent 547d9a9 commit a185685

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed

lifecycleScripts/install.js

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ return whichNativeNodish("..")
2323
console.info("[nodegit] Must build for node-webkit/nw.js");
2424
return prepareAndBuild();
2525
}
26+
var args = []
27+
if (asVersion) {
28+
args.push("--runtime=electron")
29+
console.info("version: " + asVersion)
30+
args.push("--target=" + asVersion)
31+
}
2632
// if (fs.existsSync(local("../.didntcomefromthenpmregistry"))) {
2733
// return prepareAndBuild();
2834
// }
@@ -34,21 +40,26 @@ return whichNativeNodish("..")
3440
console.info("[nodegit] BUILD_ONLY is set to true, no fetching allowed.");
3541
return prepareAndBuild();
3642
}
37-
console.info("[nodegit] Fetching binary from S3.");
38-
return exec("node-pre-gyp install")
39-
.then(
40-
function() {
41-
console.info("[nodegit] Completed installation successfully.");
42-
},
43-
function(err) {
44-
console.info("[nodegit] Failed to install prebuilt binary, " +
45-
"building manually.");
46-
console.error(err);
47-
return prepareAndBuild();
48-
}
49-
);
43+
return installWithPreGyp(args)
5044
});
5145

46+
function installWithPreGyp(args) {
47+
console.info("[nodegit] Fetching binary from S3.");
48+
var arguments = args.join(' ')
49+
return exec("node-pre-gyp install " + arguments)
50+
.then(
51+
function() {
52+
console.info("[nodegit] Completed installation successfully.");
53+
},
54+
function(err) {
55+
console.info("[nodegit] Failed to install prebuilt binary, " +
56+
"building manually.");
57+
console.error(err);
58+
return prepareAndBuild();
59+
}
60+
);
61+
}
62+
5263

5364
function prepareAndBuild() {
5465
console.info("[nodegit] Regenerating and configuring code");

0 commit comments

Comments
 (0)