Tags: jakub-g/grunt
Tags
Fixing the exit process. Under some environments (especially cygwin on Windows, but also when piping grunt's output to another program), exiting the process too quickly with process.exit may hide some errors or warnings logged with console.log but not yet displayed. This problem will apparently not be fixed in node.js itself. In Grunt, a grunt.util.exit method already exists, which waits for the output to be properly processed before exiting. However, there are some places where process.exit is still used. Moreover grunt.util.exit is using properties which are not part of the public API of node.js. This commit fixes those issues and adds a grunt.util.hasExited method which returns whether grunt.util.exit was called. This new method is now called after a task is completed, before trying to do anything more, so that no new task is executed after calling grunt.util.exit.