Skip to content

Commit

Permalink
Fix: Dodge the isTTY check on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Nov 29, 2018
1 parent d7a1445 commit 9a3a662
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ var timestamp = require('time-stamp');
var supportsColor = require('color-support');
var nodeVersion = require('parse-node-version')(process.version);

var colorDetectionOptions = {
// If on Windows, ignore the isTTY check
// This is due to AppVeyor (and thus probably common Windows platforms?) failing the check
// TODO: If this is too broad, we can reduce it to an APPVEYOR env check
ignoreTTY: (process.platform === 'win32'),
};

// Needed to add this because node 10 decided to start coloring log output randomly
var console;
if (nodeVersion.major >= 10) {
Expand All @@ -32,7 +39,7 @@ function addColor(str) {
return gray(str);
}

if (supportsColor()) {
if (supportsColor(colorDetectionOptions)) {
return gray(str);
}

Expand Down

0 comments on commit 9a3a662

Please sign in to comment.