Skip to content

Commit

Permalink
improve CI detection in the postinstall script, close #707
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Dec 2, 2019
1 parent 5ad5f62 commit 751549e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Improved iOS compat data - added mapping iOS 12.2 -> Safari 12.1, added bug fixes from patch releases
- Added missed in `core-js-compat` helpers `ie_mob` normalization
- Normalize the result of `getModulesListForTargetVersion` `core-js-compat` helper
- Improved CI detection in the `postinstall` script, [#707](https://github.com/zloirock/core-js/issues/707)

##### 3.4.5 - 2019.11.28
- Detect incorrect order of operations in `Object.assign`, MS Edge bug
Expand Down
9 changes: 8 additions & 1 deletion packages/core-js/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@ var path = require('path');
var env = process.env;

var ADBLOCK = is(env.ADBLOCK);
var CI = is(env.CI);
var COLOR = is(env.npm_config_color);
var DISABLE_OPENCOLLECTIVE = is(env.DISABLE_OPENCOLLECTIVE);
var SILENT = ['silent', 'error', 'warn'].indexOf(env.npm_config_loglevel) !== -1;
var MINUTE = 60 * 1000;

// you could add a PR with an env variable for your CI detection
var CI = [
'BUILD_NUMBER',
'CI',
'CONTINUOUS_INTEGRATION',
'RUN_ID'
].some(function (it) { return is(env[it]); });

var BANNER = '\u001B[96mThank you for using core-js (\u001B[94m https://github.com/zloirock/core-js \u001B[96m) for polyfilling JavaScript standard library!\u001B[0m\n\n' +
'\u001B[96mThe project needs your help! Please consider supporting of core-js on Open Collective or Patreon: \u001B[0m\n' +
'\u001B[96m>\u001B[94m https://opencollective.com/core-js \u001B[0m\n' +
Expand Down

0 comments on commit 751549e

Please sign in to comment.