Skip to content

Commit ec20016

Browse files
farnabazlukeed
andauthoredJun 26, 2022
fix: supply process.env fallback (#54)
* fix: handle undefined `process.env` * chore: update `kleur/colors` too Co-authored-by: Luke Edwards <luke.edwards05@gmail.com>
1 parent 06f28e0 commit ec20016

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎colors.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
let FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY=true;
22
if (typeof process !== 'undefined') {
3-
({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env);
3+
({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {});
44
isTTY = process.stdout && process.stdout.isTTY;
55
}
66

‎index.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
let FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY=true;
44
if (typeof process !== 'undefined') {
5-
({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env);
5+
({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {});
66
isTTY = process.stdout && process.stdout.isTTY;
77
}
88

0 commit comments

Comments
 (0)
Please sign in to comment.