FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

log output from node-gyp · nodegit/nodegit@75f618a · GitHub

Repository navigation

Commit 75f618a

Browse files
committed
log output from node-gyp
1 parent 4c2af33 commit 75f618a

1 file changed

Lines changed: 21 additions & 18 deletions

File tree

‎lifecycleScripts/install.js‎

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
var promisify = require("promisify-node");
22
var path = require("path");
33
var fs = require("fs");
4-
4+
var cp = require("child_process");
55
var prepareForBuild = require("./prepareForBuild");
66

77
var exec = promisify(function(command, opts, callback) {
8-
return require("child_process").exec(command, opts, callback);
8+
return cp.exec(command, opts, callback);
99
});
1010

1111
var fromRegistry;
@@ -52,7 +52,8 @@ function installPrebuilt() {
5252

5353
function pathForTool(name) {
5454
var toolPath = path.resolve(".", "node_modules", ".bin", name);
55-
toolPath = "\"" + toolPath + "\"";
55+
// toolPath = "\"" + toolPath + "\"";
56+
toolPath += '.cmd':
5657
return toolPath;
5758
}
5859

@@ -72,7 +73,8 @@ function build() {
7273
var opts = {
7374
cwd: ".",
7475
maxBuffer: Number.MAX_VALUE,
75-
env: process.env
76+
env: process.env,
77+
stdio: 'inherit'
7678
};
7779

7880
var builder = "node-gyp";
@@ -104,26 +106,27 @@ function build() {
104106

105107
opts.env.HOME = path.join(home, ".nodegit-gyp");
106108

107-
var cmd = [
108-
pathForTool(builder),
109+
var cmd = pathForTool(builder);
110+
var args = [
109111
"rebuild",
110112
debug,
111113
target,
112114
distUrl
113115
]
114116
.join(" ")
115-
.trim();
116-
117-
return exec(cmd, opts)
118-
.then(function() {
119-
console.info("[nodegit] Compilation complete.");
120-
console.info("[nodegit] Completed installation successfully.");
121-
process.exitCode = 0;
122-
},
123-
function(err, stderr) {
124-
console.error(err);
125-
console.error(stderr);
117+
.trim()
118+
.split(" ");
119+
return new Promise(function(resolve, reject) {
120+
var child = cp.spawn(cmd, args, opts);
121+
child.on("close", function(code) {
122+
console.log(code);
123+
if (code) {
124+
reject(code);
126125
process.exitCode = 13;
127126
}
128-
);
127+
else {
128+
resolve();
129+
}
130+
})
131+
});
129132
}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL