Skip to content

Commit 80c1a21

Browse files
authoredJul 21, 2019
Merge pull request #33 from avh4/faster-startup
Reduce startup time by only parsing package details when the brinarie…
2 parents 7640a0e + c011c14 commit 80c1a21

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎binstub.js.mustache

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
var path = require("path");
33
var spawn = require("child_process").spawn;
44
var fs = require("fs");
5-
var packageInfo = require(path.join(__dirname, "..", "package.json"));
6-
var package = require(path.join(__dirname, "..", packageInfo.main));
75

86
var os = process.env.BINWRAP_PLATFORM || process.platform;
97
var arch = process.env.BINWRAP_ARCH || process.arch;
@@ -34,6 +32,10 @@ if (fs.existsSync(binPath)) {
3432
execBin();
3533
} else {
3634
console.error("INFO: Running " + path.basename(__filename) + " for the first time; downloading the actual binary");
35+
36+
var packageInfo = require(path.join(__dirname, "..", "package.json"));
37+
var package = require(path.join(__dirname, "..", packageInfo.main));
38+
3739
package.install(unpackedBinPath, os, arch).then(function(result) {
3840
execBin();
3941
}, function(err) {

0 commit comments

Comments
 (0)
Please sign in to comment.