grunt-subgrunt
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "grunt-subgrunt", | ||
"version": "0.1.0", | ||
"description": "Run grunt for gruntfiles in sub directories.", | ||
"version": "0.1.1", | ||
"description": "Run sub-projects' grunt tasks.", | ||
"repository": { | ||
@@ -28,3 +28,4 @@ "type": "git", | ||
"dependencies": { | ||
"lpad": "~0.1.0" | ||
"lpad": "~0.1.0", | ||
"colors": "~0.6.1" | ||
}, | ||
@@ -31,0 +32,0 @@ "engines": { |
# grunt-subgrunt [![Build Status](https://secure.travis-ci.org/tusbar/grunt-subgrunt.png?branch=master)](https://travis-ci.org/tusbar/grunt-subgrunt) | ||
> Run grunt for gruntfiles in sub directories. | ||
> Run sub-projects' grunt tasks. | ||
> This plugin was inspired by https://gist.github.com/cowboy/3819170. | ||
@@ -47,9 +47,9 @@ | ||
#### options.npmInstall | ||
Type: `bool` | ||
Type: `bool` | ||
Default value: `true` | ||
Determines wether `npm install` will be ran in the sub directory (thus installing dev dependencies). | ||
Determines wether `npm install` will be ran for the sub-project (thus installing dev dependencies). | ||
#### options.npmPath | ||
Type: `string` | ||
Type: `string` | ||
Default value: `'npm'` | ||
@@ -66,3 +66,3 @@ | ||
modules: { | ||
// For each of these directories, the specified grunt task will be executed: | ||
// For each of these projects, the specified grunt task will be executed: | ||
'node_modules/module1': 'default', | ||
@@ -69,0 +69,0 @@ 'node_modules/module2': 'bower:install' |
'use strict'; | ||
var lpad = require('lpad'); | ||
var colors = require('colors'); | ||
@@ -7,4 +8,2 @@ module.exports = function (grunt) { | ||
var runNpmInstall = function (path, options, next) { | ||
grunt.log.ok('Installing npm modules in "' + path + '".'); | ||
grunt.util.spawn({ | ||
@@ -16,10 +15,10 @@ cmd: options.npmPath, | ||
if (err || code > 0) { | ||
grunt.warn(result.stderr || result.stdout); | ||
grunt.log.error('Failed installing node modules in "' + path + '".'); | ||
grunt.warn('\n' + lpad(result.stderr || result.stdout, ' ! '.yellow)); | ||
} | ||
if (result.stdout) { | ||
lpad.stdout(' | '); | ||
grunt.log.write(result.stdout); | ||
lpad.stdout(); | ||
grunt.log.write('\n'); | ||
else { | ||
grunt.log.ok('Installed node modules in "' + path + '".'); | ||
if (result.stdout) { | ||
grunt.log.writeln(lpad(result.stdout, ' | ')); | ||
} | ||
} | ||
@@ -32,4 +31,2 @@ | ||
var runGruntTasks = function (path, tasks, options, next) { | ||
grunt.log.ok('Running "grunt ' + tasks.join(' ') + '" in "' + path + '".'); | ||
grunt.util.spawn({ | ||
@@ -41,9 +38,10 @@ grunt: true, | ||
if (err || code > 0) { | ||
grunt.warn(result.stderr || result.stdout); | ||
grunt.log.error('Failed running "grunt ' + tasks.join(' ') + '" in "' + path + '".'); | ||
grunt.warn('\n' + lpad(result.stderr || result.stdout, ' ! '.yellow)); | ||
} | ||
if (result.stdout) { | ||
lpad.stdout(' | '); | ||
grunt.log.write(result.stdout); | ||
lpad.stdout(); | ||
else { | ||
grunt.log.ok('Ran "grunt ' + tasks.join(' ') + '" in "' + path + '".'); | ||
if (result.stdout) { | ||
grunt.log.writeln(lpad(result.stdout, ' | ')); | ||
} | ||
} | ||
@@ -55,3 +53,3 @@ | ||
grunt.registerMultiTask('subgrunt', 'Run grunt for gruntfiles in sub directories', function () { | ||
grunt.registerMultiTask('subgrunt', 'Run sub-projects\' grunt tasks.', function () { | ||
var cb = this.async(); | ||
@@ -58,0 +56,0 @@ var options = this.options({ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7222
94
3
+ Addedcolors@~0.6.1