Exclude PATH entries with msbuild.exe to fix node-gyp on Windows

This commit is contained in:
Damien Guard 2016-03-22 17:26:41 -07:00 committed by Nathan Sobo
parent 76f9f43e6a
commit df4e552596

View File

@ -2,9 +2,24 @@
var cp = require('./utils/child-process-wrapper.js');
var runGrunt = require('./utils/run-grunt.js');
var path = require('path');
var fs = require('fs');
process.chdir(path.dirname(__dirname));
if (process.platform === 'win32') {
process.env['PATH'] = process.env['PATH']
.split(';')
.filter(function(p) {
if (fs.existsSync(path.resolve(p, 'msbuild.exe'))) {
console.log('Excluding "' + p + '" from PATH to avoid msbuild.exe mismatch')
return false;
} else {
return true;
}
})
.join(';');
}
cp.safeExec('node script/bootstrap', function() {
// build/node_modules/.bin/grunt "$@"
var args = process.argv.slice(2);