File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,14 @@ function _getRandomTip () {
2222 return TIPS [ Math . floor ( Math . random ( ) * TIPS . length ) ]
2323}
2424
25+ function supportsAnsi ( ) {
26+ return process . stdout . isTTY && process . env . TERM !== 'dumb'
27+ }
28+
29+ function dim ( text ) {
30+ return supportsAnsi ( ) ? `\x1b[2m${ text } \x1b[0m` : text
31+ }
32+
2533const LINE = / (?: ^ | ^ ) \s * (?: e x p o r t \s + ) ? ( [ \w . - ] + ) (?: \s * = \s * ?| : \s + ?) ( \s * ' (?: \\ ' | [ ^ ' ] ) * ' | \s * " (?: \\ " | [ ^ " ] ) * " | \s * ` (?: \\ ` | [ ^ ` ] ) * ` | [ ^ # \r \n ] + ) ? \s * (?: # .* ) ? (?: $ | $ ) / mg
2634
2735// Parse src into an Object
@@ -290,7 +298,7 @@ function configDotenv (options) {
290298 }
291299 }
292300
293- _log ( `injecting env (${ keysCount } ) from ${ shortPaths . join ( ',' ) } – [ tip] ${ _getRandomTip ( ) } ` )
301+ _log ( `injecting env (${ keysCount } ) from ${ shortPaths . join ( ',' ) } ${ dim ( `( tip: ${ _getRandomTip ( ) } )` ) } ` )
294302 }
295303
296304 if ( lastError ) {
You can’t perform that action at this time.
0 commit comments