title: Grunt run by Teamcity does not properly output to log
body: <p>I have a teamcity build running grunt as a command line task.</p>
  
  <p>When I execute <code>grunt default</code> the output (in the Teamcity logs) does not contain the relevant error output from grunt. It do however return the appropriate non-zero exit code, which cause the teamcity build to fail correctly. I do not get the grunt error log though.</p>
  
  <p>This page: <a href="https://www.npmjs.org/package/grunt-teamcity" rel="nofollow">https://www.npmjs.org/package/grunt-teamcity</a> describes the following workaround for the issue that I'm facing:</p>
  
  <blockquote>
    <p>Teamcity on windows does not flush the stdout stream before exiting
    the grunt node process. There has been some work around this in both
    nodejs and grunt, but it is by no means resolved. If you see missing
    output in your Teamcity build log then try running the grunt task
    using the TC command line runner by redirecting output to a file, e.g:</p>
    
    <p>grunt default --no-color > grunt.tmp &amp; type grunt.tmp &amp; del grunt.tmp
    Seems that by redirecting to a file the output is synchronous, whereas
    with pipe (or TC plugin execute method) the output is async and not
    captured before the node process exits.</p>
  </blockquote>
  
  <p>So it basically suggest that you run grunt like this: <code>grunt default --no-color &gt; grunt.tmp &amp; type grunt.tmp &amp; del grunt.tmp</code>. The problem with this approach however is that is always return 0 (zero) as the exit code, which mean that my Teamcity build does not properly fail.</p>
  
  <p>I imagine this can be fixed with some creative batch scripting, but I'm not sure how to approach this.</p>