Skip to content

Commit 88488a0

Browse files
committed
Fix "npm install" in dev
1 parent b38973b commit 88488a0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/install.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,14 @@ var force_lib_rebuild = process.argv.includes("-force-lib-rebuild");
3939
function provideNinja() {
4040
var vendor_ninja_version = "1.9.0.git";
4141
var ninja_source_dir = path.join(root_dir, "vendor", "ninja");
42+
4243
function build_ninja() {
4344
console.log(`building ninja`);
4445
ensureExists(ninja_source_dir);
46+
4547
if (fs.existsSync(path.join(root_dir, "vendor", "ninja.tar.gz"))) {
48+
// Build from source on installation of the npm package
49+
// for platforms where we don't provide a pre-built binary.
4650
console.log("Extracting ninja sources...");
4751
child_process.execSync(`tar xzf ../ninja.tar.gz`, {
4852
cwd: ninja_source_dir,
@@ -59,8 +63,8 @@ function provideNinja() {
5963
ninja_bin_output
6064
);
6165
} else {
62-
console.log(`ninja.tar.gz not availble in CI mode`);
63-
require("../ninja/snapshot").build();
66+
// Build from source for "npm install" in local dev.
67+
require("../scripts/buildNinjaBinary");
6468
fs.copyFileSync(
6569
path.join(root_dir, "ninja", ninja_bin_filename),
6670
ninja_bin_output

0 commit comments

Comments
 (0)