Skip to content

Commit

Permalink
update the postinstall script
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Nov 24, 2020
1 parent 4cfb0ec commit 160e61a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## Changelog
##### Unreleased
- Added `OPEN_SOURCE_CONTRIBUTOR` detection in `postinstall`
- Added Drone CI in `postinstall` detection

##### 2.6.11 [LEGACY] - 2019.12.09
- Returned usage of `node -e` in `postinstall` scripts for better cross-platform compatibility, [#582](https://github.com/zloirock/core-js/issues/582)
- Improved CI detection in the `postinstall` script, [#707](https://github.com/zloirock/core-js/issues/707)
Expand Down
4 changes: 3 additions & 1 deletion postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ var ADBLOCK = is(env.ADBLOCK);
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 OPEN_SOURCE_CONTRIBUTOR = is(env.OPEN_SOURCE_CONTRIBUTOR);
var MINUTE = 60 * 1000;

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

Expand All @@ -29,7 +31,7 @@ function is(it) {
}

function isBannerRequired() {
if (ADBLOCK || CI || DISABLE_OPENCOLLECTIVE || SILENT) return false;
if (ADBLOCK || CI || DISABLE_OPENCOLLECTIVE || SILENT || OPEN_SOURCE_CONTRIBUTOR) return false;
var file = path.join(os.tmpdir(), 'core-js-banners');
var banners = [];
try {
Expand Down

0 comments on commit 160e61a

Please sign in to comment.