grunt-shell
Advanced tools
Comparing version 0.3.0 to 0.3.1
{ | ||
"name": "grunt-shell", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Run shell commands", | ||
@@ -12,2 +12,3 @@ "keywords": [ | ||
"spawn", | ||
"process", | ||
"cli" | ||
@@ -29,2 +30,5 @@ ], | ||
}, | ||
"dependencies": { | ||
"stripcolorcodes": "~0.1.0" | ||
}, | ||
"devDependencies": { | ||
@@ -41,3 +45,6 @@ "grunt": "~0.4.0" | ||
"type": "MIT" | ||
} | ||
}, | ||
"files": [ | ||
"tasks/shell.js" | ||
] | ||
} |
'use strict'; | ||
module.exports = function (grunt) { | ||
var exec = require('child_process').exec; | ||
var stripColors = require('stripcolorcodes'); | ||
var _ = grunt.util._; | ||
@@ -32,2 +33,12 @@ | ||
var captureOutput = function (child, output) { | ||
if (grunt.option('color') === false) { | ||
child.on('data', function (data) { | ||
output.write(stripColors(data)); | ||
}); | ||
} else { | ||
child.pipe(output); | ||
} | ||
}; | ||
grunt.verbose.writeln('Command:', cmd.yellow); | ||
@@ -37,9 +48,9 @@ grunt.verbose.writeflags(options, 'Options'); | ||
if (options.stdout || grunt.option('verbose')) { | ||
cp.stdout.pipe(process.stdout); | ||
captureOutput(cp.stdout, process.stdout); | ||
} | ||
if (options.stderr || grunt.option('verbose')) { | ||
cp.stderr.pipe(process.stderr); | ||
captureOutput(cp.stderr, process.stderr); | ||
} | ||
}); | ||
}; |
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
6495
46
2
3
+ Addedstripcolorcodes@~0.1.0
+ Addedstripcolorcodes@0.1.0(transitive)