Skip to content

Commit

Permalink
Merge pull request #92 from aga5tya/sort-conditions-color-support
Browse files Browse the repository at this point in the history
fix(utils): sort the determination order
  • Loading branch information
caiogondim authored Jul 17, 2017
2 parents a2453a1 + 0598822 commit 3f1dea8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/util/is-color-supported/node.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
module.exports = function isColorSupported () {
if (process.stdout && !process.stdout.isTTY) {
return false
}

if (process.platform === 'win32') {
return true
}
Expand All @@ -11,15 +7,19 @@ module.exports = function isColorSupported () {
return true
}

if (process.env.TERM === 'dumb') {
return false
}

if (
/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)
) {
return true
}

if (process.env.TERM === 'dumb') {
return false
}

if (process.stdout && !process.stdout.isTTY) {
return false
}

return false
}

0 comments on commit 3f1dea8

Please sign in to comment.