Bug fix: Failed grunt tasks not failing MSBuild target#6
Open
jamiegaines wants to merge 2 commits intoBlacklite:masterfrom
Open
Bug fix: Failed grunt tasks not failing MSBuild target#6jamiegaines wants to merge 2 commits intoBlacklite:masterfrom
jamiegaines wants to merge 2 commits intoBlacklite:masterfrom
Conversation
…alled taks is not equal to zero, regardless of what is in stderr
… overwriting %ERRORLEVEL% variable generated by grunt
Contributor
|
At first glance I don't see any problems, I'll attempt to take a look at test again on the weekend. |
|
What is the status of this? Gulp has the same problem of not failing the build and it would be great to see that remedied. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've been using Ncapsulate today to convert a convoluted gruntfile run from the command line into delicious MSBuild awesomeness. This library has been a huge help to me today, so thanks!
I encountered two problems while using the library today. First, when a grunt task fails, the environment exit code is set to 3, but the CmdTask.ExecAsync class kept returning a 0. I finally figured out that the final call in grunt.cmd, echo on, was overwriting the %errorlevel% variable.
So the first change in the pull requests just removes that call from the grunt.cmd file generated by the nuget install script. I don't think it affects anything to remove that line from the batch file.
Once I got that straightened out, the task still wasn't failing because of the line in CmdTask.ExecWithOutputResultAsync that was evaluating the process result. If the error code was 0 OR the stdError was empty, then it assumed that the process was successful.
I changed it so that if the error code does not equal 0, then it assumes there is an error. Then it tries to return stdError as the error message, and then stdOut if stdError is empty. This was the case with grunt, where the exit code was 3 because the task failed, but stdError was empty.
Anyway, I'm not sure if you want to use this or not. This is my first pull request ever so I'm not sure I'm doing it right. Let me know if you have questions/comment, and thanks again for such a helpful library.