nunta/node_modules/grunt/internal-tasks/subgrunt.js
David Miller 0025e7e961 setting up Gruntfile and dist folder
index.html, mail/, bootstrap and jquery bower components will build to
the dist folder when running grunt
2014-08-12 21:01:38 -04:00

35 lines
976 B
JavaScript

/*
* grunt
* http://gruntjs.com/
*
* Copyright (c) 2014 "Cowboy" Ben Alman
* Licensed under the MIT license.
* https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT
*/
'use strict';
module.exports = function(grunt) {
// Run sub-grunt files, because right now, testing tasks is a pain.
grunt.registerMultiTask('subgrunt', 'Run a sub-gruntfile.', function() {
var path = require('path');
grunt.util.async.forEachSeries(this.filesSrc, function(gruntfile, next) {
grunt.log.write('Loading ' + gruntfile + '...');
grunt.util.spawn({
grunt: true,
args: ['--gruntfile', path.resolve(gruntfile)],
}, function(error, result) {
if (error) {
grunt.log.error().error(result.stdout).writeln();
next(new Error('Error running sub-gruntfile "' + gruntfile + '".'));
} else {
grunt.log.ok().verbose.ok(result.stdout);
next();
}
});
}, this.async());
});
};