Skip to content

Commit 5e64f4a

Browse files
authored
Merge pull request #102 from ericcornelissen/85-no-color
Respect the `NO_COLOR` environment variable
2 parents b2f400f + 4a4fe64 commit 5e64f4a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/utils/color.ts

+4
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ const COLORS = <const>{
4949
* @return {String} Message
5050
*/
5151
export function color(message: string, fgColor?: Color, bgColor?: Color): string {
52+
if ('NO_COLOR' in process.env) {
53+
return message;
54+
}
55+
5256
return [
5357
<ColorCode>get(COLORS, `${fgColor}.fg`, ''),
5458
<ColorCode>get(COLORS, `${bgColor}.bg`, ''),

0 commit comments

Comments
 (0)