Skip to content

Commit

Permalink
tty: support more CI services in getColorDepth
Browse files Browse the repository at this point in the history
PR-URL: #40385
Refs: sindresorhus/yoctocolors#5
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
Richienb authored and BethGriggs committed Nov 24, 2021
1 parent 579f01c commit 7d550ad
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/internal/tty.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,15 @@ function getColorDepth(env = process.env) {
}

if (env.CI) {
if ('TRAVIS' in env || 'CIRCLECI' in env || 'APPVEYOR' in env ||
'GITLAB_CI' in env || env.CI_NAME === 'codeship') {
if ([
'APPVEYOR',
'BUILDKITE',
'CIRCLECI',
'DRONE',
'GITHUB_ACTIONS',
'GITLAB_CI',
'TRAVIS',
].some((sign) => sign in env) || env.CI_NAME === 'codeship') {
return COLORS_256;
}
return COLORS_2;
Expand Down

0 comments on commit 7d550ad

Please sign in to comment.