You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
627 B

  1. /*
  2. * grunt
  3. * http://gruntjs.com/
  4. *
  5. * Copyright (c) 2013 "Cowboy" Ben Alman
  6. * Licensed under the MIT license.
  7. * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT
  8. */
  9. 'use strict';
  10. // This seems to be required in Windows (as of Node.js 0.8.7) to ensure that
  11. // stdout/stderr are flushed before the process exits.
  12. // https://gist.github.com/3427148
  13. // https://gist.github.com/3427357
  14. exports.exit = function exit(exitCode) {
  15. if (process.stdout._pendingWriteReqs || process.stderr._pendingWriteReqs) {
  16. process.nextTick(function() {
  17. exit(exitCode);
  18. });
  19. } else {
  20. process.exit(exitCode);
  21. }
  22. };