-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.js
More file actions
30 lines (24 loc) · 752 Bytes
/
build.js
File metadata and controls
30 lines (24 loc) · 752 Bytes
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
var nrp = require("npm-run-path");
var spawn = require("cross-spawn");
var argv = require("minimist")(process.argv.slice(2));
console.log(argv);
const runtime = argv["runtime"] || "node";
const target = argv["target"] || process.versions.node;
const abi = argv["abi"] || process.versions.modules;
const arch = argv["arch"] || process.arch;
console.log(`\n[BUILD] ${runtime} v${target} | ABI ${abi} | arch ${arch}`);
var ps = spawn("cmake-js", [
"rebuild",
"-r", runtime,
"-v", target,
"--abi", abi,
"--arch", arch
], {
env: nrp.env()
});
ps.stdout.pipe(process.stdout);
ps.stderr.pipe(process.stderr);
ps.on("exit", function (statusCode) {
console.log("[BUILD] Done");
process.exit(statusCode);
});