Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
stdout not flushed on process.exit (Windows only) #504
The subject is nearly the whole story and there is no problem while working from within the command shell only. But it leads to missing logs when the console output is redirected to other processes, such as IDEs.
Anyhow, the issue is that process.exit() will terminate node immediately, even if there are still queued writes to stdout. A workaround would be to simply remove this call where possible.
In case of grunt this would be /lib/grunt.js (line 135) for successfull builds. ;-)
But I have no idea how to handle failed builds (/lib/grunt/fail.js, lines 42 and 73), since the call to process.exit is required for errorcodes there. Maybe there is some way to explicitly flush stdout and stderr before exiting, but I could not figure out how...