diff --git a/CHANGELOG.md b/CHANGELOG.md index e22ba166b0c5..ce99244c2394 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ ## Changelog +##### 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) + ##### 2.6.10 [LEGACY] - 2019.10.13 - Show similar `postinstall` messages only once per `npm i`, [#597](https://github.com/zloirock/core-js/issues/597) diff --git a/package.json b/package.json index 400942affa6f..533b323a4b7d 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "promises-tests": "promises-aplus-tests tests/promises-aplus/adapter", "observables-tests": "node tests/observables/adapter && node tests/observables/adapter-library", "test": "npm run grunt clean copy && npm run lint && npm run grunt livescript client karma:default && npm run grunt library karma:library && npm run promises-tests && npm run observables-tests && lsc tests/commonjs", - "postinstall": "node postinstall || echo \"ignore\"" + "postinstall": "node -e \"try{require('./postinstall')}catch(e){}\"" }, "license": "MIT", "keywords": [ diff --git a/postinstall.js b/postinstall.js index d13423937ca2..fcb8d3cb5b93 100644 --- a/postinstall.js +++ b/postinstall.js @@ -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' +