exit.js 424 B

1234567891011121314151617
  1. module.exports = function(exitCode, platform, nodeVersion, exit, nodeExit) {
  2. if(isWindows(platform) && olderThan12(nodeVersion)) {
  3. nodeExit(exitCode);
  4. }
  5. else {
  6. exit(exitCode);
  7. }
  8. };
  9. function isWindows(platform) {
  10. return /^win/.test(platform);
  11. }
  12. function olderThan12(nodeVersion) {
  13. var version = nodeVersion.split('.');
  14. return parseInt(version[0].substr(1), 10) <= 0 && parseInt(version[1], 10) < 12;
  15. }