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 <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
Richienb authored and targos committed Oct 23, 2021
1 parent 14f6c67 commit f194082
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 f194082

Please sign in to comment.