Last change
on this file was
516,
checked in by hendrikvanantwerpen, 11 years ago
|
Enable deployment with Grunt.
|
File size:
976 bytes
|
Rev | Line | |
---|
[484] | 1 | /* |
---|
| 2 | * grunt |
---|
| 3 | * http://gruntjs.com/ |
---|
| 4 | * |
---|
[516] | 5 | * Copyright (c) 2014 "Cowboy" Ben Alman |
---|
[484] | 6 | * Licensed under the MIT license. |
---|
| 7 | * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | 'use strict'; |
---|
| 11 | |
---|
| 12 | module.exports = function(grunt) { |
---|
| 13 | |
---|
| 14 | // Run sub-grunt files, because right now, testing tasks is a pain. |
---|
| 15 | grunt.registerMultiTask('subgrunt', 'Run a sub-gruntfile.', function() { |
---|
| 16 | var path = require('path'); |
---|
| 17 | grunt.util.async.forEachSeries(this.filesSrc, function(gruntfile, next) { |
---|
| 18 | grunt.log.write('Loading ' + gruntfile + '...'); |
---|
| 19 | grunt.util.spawn({ |
---|
| 20 | grunt: true, |
---|
| 21 | args: ['--gruntfile', path.resolve(gruntfile)], |
---|
| 22 | }, function(error, result) { |
---|
| 23 | if (error) { |
---|
| 24 | grunt.log.error().error(result.stdout).writeln(); |
---|
| 25 | next(new Error('Error running sub-gruntfile "' + gruntfile + '".')); |
---|
| 26 | } else { |
---|
| 27 | grunt.log.ok().verbose.ok(result.stdout); |
---|
| 28 | next(); |
---|
| 29 | } |
---|
| 30 | }); |
---|
| 31 | }, this.async()); |
---|
| 32 | }); |
---|
| 33 | |
---|
| 34 | }; |
---|
Note: See
TracBrowser
for help on using the repository browser.