Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion install.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ var spawn = require('child_process').spawn;
var fs = require('fs');
var version = JSON.parse(fs.readFileSync(__dirname + '/package.json', 'utf8')).version;
var verbose = process.env['npm_package_config_verbose'] != null ? process.env['npm_package_config_verbose'] === 'true' : false;
var isWindows = require('os').platform().indexOf('win') === 0;

console.log('[execsync v%s] Attempting to compile native extensions.', version);

var gyp = spawn('node-gyp', ['rebuild'], {cwd: __dirname});
// While node-gyp is runnable in Windows from the command line as `node-gyp`,
// it's actually defined in the file `node-gyp.cmd`.
// Relevant bug: https://github.com/joyent/node/issues/2318
var gyp = spawn(isWindows ? 'node-gyp.cmd' : 'node-gyp', ['rebuild'], {cwd: __dirname});
gyp.stdout.on('data', function(data) {
if (verbose) process.stdout.write(data);
});
Expand Down