Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I remove all color information from Grunt output?

I'm a little new to Grunt and am using it in our automated build system (on Windows). When running Grunt manually in the console, the coloring is extremely helpful. However, when running it in an automated setup, it results in color information in the build log, like this:

[4mRunning "sass:all" (sass) task [24m

The extra characters decrease the readability of the build log and I'd like to get rid of them.

I'm aware of the grunt.log.uncolor method for individual strings, but I'm wondering if there's a way to configure Grunt to output all logs without color information or if there's an existing plugin to do this. If not, I'll likely write my own plugin.

I feel like this would be a common occurrence — using Grunt in an automated system where you'd want to read the build log as plain text — so maybe I'm just missing something.

like image 358
lshearer Avatar asked Jun 20 '14 15:06

lshearer


1 Answers

Of course, I finally find the answer right after asking the question...

Use the simple command-line option --no-color.

I was scouring the API but somehow missed the "Using the CLI" section of the documentation.

like image 136
lshearer Avatar answered Sep 28 '22 00:09

lshearer