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
+ }
2
9
process . env . DEBUG_COLORS = 'true' ;
3
10
4
11
const puppeteer = require ( 'puppeteer' ) ;
5
12
const lighthouse = require ( 'lighthouse' ) ;
6
13
const log = require ( 'lighthouse-logger' ) ;
7
14
const chromeLauncher = require ( 'chrome-launcher' ) ;
8
15
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
+
9
23
const getBrowserPath = async ( ) => {
10
24
const browserFetcher = puppeteer . createBrowserFetcher ( ) ;
11
25
const revisions = await browserFetcher . localRevisions ( ) ;
You can’t perform that action at this time.
0 commit comments