Check for that grunt command exists before spawning
Esse commit está contido em:
@@ -1,9 +1,17 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
var cp = require('./utils/child-process-wrapper.js');
|
var cp = require('./utils/child-process-wrapper.js');
|
||||||
|
var fs = require('fs');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
|
|
||||||
// node build/node_modules/.bin/grunt "$@"
|
// node build/node_modules/.bin/grunt "$@"
|
||||||
var gruntPath = path.resolve(__dirname, '..', 'build', 'node_modules', '.bin', 'grunt') + (process.platform === 'win32' ? '.cmd' : '');
|
var gruntPath = path.resolve(__dirname, '..', 'build', 'node_modules', '.bin', 'grunt') + (process.platform === 'win32' ? '.cmd' : '');
|
||||||
|
|
||||||
|
if (!fs.existsSync(gruntPath)) {
|
||||||
|
console.error('Grunt command does not exist at: ' + gruntPath);
|
||||||
|
console.error('Run script/bootstrap to install Grunt');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
var args = ['--gruntfile', path.resolve('build', 'Gruntfile.coffee')];
|
var args = ['--gruntfile', path.resolve('build', 'Gruntfile.coffee')];
|
||||||
args = args.concat(process.argv.slice(2));
|
args = args.concat(process.argv.slice(2));
|
||||||
cp.safeSpawn(gruntPath, args, process.exit);
|
cp.safeSpawn(gruntPath, args, process.exit);
|
||||||
|
|||||||
Referência em uma Nova Issue
Bloquear um usuário