Skip to content

Commit

Permalink
feat: support Netlify (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky authored Apr 6, 2021
1 parent 6af53f6 commit 1246ad6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ function supportsHyperlink(stream) {
return false;
}

if ('NETLIFY' in env) {
return true;
}

if ('CI' in env) {
return false;
}
Expand Down
9 changes: 9 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,15 @@ test('disabled in TEAMCITY', t => {
}));
});

test('enabled in Netlify build logs', t => {
t.true(isSupported({
env: {
CI: 'true',
NETLIFY: 'true'
}
}));
});

test('not supported if TERM_PROGRAM exists, but TERM_VERSION does not', t => {
t.false(isSupported({
env: {
Expand Down

0 comments on commit 1246ad6

Please sign in to comment.