Fix executing grunt under Windows.

This commit is contained in:
Cheng Zhao
2014-01-18 20:56:10 +08:00
parent ced02faf0f
commit cf4e08cdc0

View File

@@ -2,8 +2,8 @@
var cp = require('./utils/child-process-wrapper.js');
var path = require('path');
// node build/node_modules/grunt-cli/bin/grunt "$@"
var gruntPath = path.resolve(__dirname, '..', 'build', 'node_modules', 'grunt-cli', 'bin', 'grunt') + (process.platform === 'win32' ? '.cmd' : '');
var args = [gruntPath, '--gruntfile', path.resolve('build', 'Gruntfile.coffee')];
// node build/node_modules/.bin/grunt "$@"
var gruntPath = path.resolve(__dirname, '..', 'build', 'node_modules', '.bin', 'grunt') + (process.platform === 'win32' ? '.cmd' : '');
var args = ['--gruntfile', path.resolve('build', 'Gruntfile.coffee')];
args = args.concat(process.argv.slice(2));
cp.safeSpawn(process.execPath, args, process.exit);
cp.safeSpawn(gruntPath, args, process.exit);