File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,8 @@ function buildLocalCommands(cli, isLocalSite) {
6060 function getCommandHandler ( command , handler ) {
6161 return argv => {
6262 report . setVerbose ( ! ! argv . verbose )
63-
63+ report . setNoColor ( ! ! argv . noColor )
64+
6465 process . env . gatsby_log_level = argv . verbose ? `verbose` : `normal`
6566 report . verbose ( `set gatsby_log_level: "${ process . env . gatsby_log_level } "` )
6667
@@ -175,6 +176,12 @@ module.exports = (argv, handlers) => {
175176 describe : `Turn on verbose output` ,
176177 global : true ,
177178 } )
179+ . option ( `no-color` , {
180+ default : false ,
181+ type : `boolean` ,
182+ describe : `Turn off the color in output` ,
183+ global : true ,
184+ } )
178185
179186 buildLocalCommands ( cli , isLocalSite )
180187
Original file line number Diff line number Diff line change @@ -17,7 +17,11 @@ module.exports = Object.assign(reporter, {
1717 setVerbose ( isVerbose = true ) {
1818 this . isVerbose = ! ! isVerbose
1919 } ,
20-
20+ setNoColor ( isNoColor = false ) {
21+ if ( isNoColor ) {
22+ errorFormatter . withoutColors ( )
23+ }
24+ } ,
2125 panic ( ...args ) {
2226 this . error ( ...args )
2327 process . exit ( 1 )
You can’t perform that action at this time.
0 commit comments