Merge pull request #6246 from jussi-kalliokoski/fix-test-script

🎨 💚 Fixed the test script.
This commit is contained in:
Kevin Sawicki
2015-04-21 17:43:45 -07:00
4 changed files with 26 additions and 21 deletions

View File

@@ -1,13 +1,12 @@
#!/usr/bin/env node
var cp = require('./utils/child-process-wrapper.js');
var runGrunt = require('./utils/run-grunt.js');
var path = require('path');
process.chdir(path.dirname(__dirname));
cp.safeExec('node script/bootstrap', function() {
// build/node_modules/.bin/grunt "$@"
var gruntPath = path.join('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(gruntPath, args, process.exit);
var args = process.argv.slice(2);
runGrunt(args, process.exit);
});

View File

@@ -1,17 +1,6 @@
#!/usr/bin/env node
var cp = require('./utils/child-process-wrapper.js');
var fs = require('fs');
var path = require('path');
var runGrunt = require('./utils/run-grunt.js');
// node build/node_modules/.bin/grunt "$@"
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')];
args = args.concat(process.argv.slice(2));
cp.safeSpawn(gruntPath, args, process.exit);
// build/node_modules/.bin/grunt "$@"
var args = process.argv.slice(2);
runGrunt(args, process.exit);

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env node
var safeExec = require('./utils/child-process-wrapper.js').safeExec;
var runGrunt = require('./utils/run-grunt.js');
var path = require('path');
process.chdir(path.dirname(__dirname));
safeExec('node script/bootstrap', function() {
var gruntPath = path.join('node_modules', '.bin', 'grunt') + (process.platform === 'win32' ? '.cmd' : '');
safeExec(gruntPath + ' ci --stack --no-color', process.exit);
runGrunt(["ci", "--stack", "--no-color"], process.exit);
});

17
script/utils/run-grunt.js Normal file
View File

@@ -0,0 +1,17 @@
var cp = require('./child-process-wrapper.js');
var fs = require('fs');
var path = require('path');
module.exports = function(additionalArgs, callback) {
var gruntPath = path.join('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')];
args = args.concat(additionalArgs);
cp.safeSpawn(gruntPath, args, callback);
};