Skip to content

Commit

Permalink
fix: supply process.env fallback (#54)
Browse files Browse the repository at this point in the history
* fix: handle undefined `process.env`

* chore: update `kleur/colors` too

Co-authored-by: Luke Edwards <[email protected]>
  • Loading branch information
farnabaz and lukeed authored Jun 26, 2022
1 parent 06f28e0 commit ec20016
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion colors.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
let FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY=true;
if (typeof process !== 'undefined') {
({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env);
({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {});
isTTY = process.stdout && process.stdout.isTTY;
}

Expand Down
2 changes: 1 addition & 1 deletion index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

let FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY=true;
if (typeof process !== 'undefined') {
({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env);
({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {});
isTTY = process.stdout && process.stdout.isTTY;
}

Expand Down

0 comments on commit ec20016

Please sign in to comment.