File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 1- // prevent logger from prefixing a date when running in tty
1+ // we set DEBUG_COLORS = 'true' to prevent the logger from prefixing a date when running in tty
2+ // keep the old DEBUG_COLORS value so we can return it to the original value
3+ let debugColorsSet = false ;
4+ let debugColorsOriginalValue ;
5+ if ( 'DEBUG_COLORS' in process . env ) {
6+ debugColorsSet = true ;
7+ debugColorsOriginalValue = process . env . DEBUG_COLORS ;
8+ }
29process . env . DEBUG_COLORS = 'true' ;
310
411const puppeteer = require ( 'puppeteer' ) ;
512const lighthouse = require ( 'lighthouse' ) ;
613const log = require ( 'lighthouse-logger' ) ;
714const chromeLauncher = require ( 'chrome-launcher' ) ;
815
16+ // we can return the original value after requiring the dependencies
17+ if ( debugColorsSet ) {
18+ process . env . DEBUG_COLORS = debugColorsOriginalValue ;
19+ } else {
20+ delete process . env . DEBUG_COLORS ;
21+ }
22+
923const getBrowserPath = async ( ) => {
1024 const browserFetcher = puppeteer . createBrowserFetcher ( ) ;
1125 const revisions = await browserFetcher . localRevisions ( ) ;
You can’t perform that action at this time.
0 commit comments