psake/psake — pull request #47 by rbevers (2012-08-15 03:34:20+00:00)
Title: Fix for psake.ps1 and psake.cmd errorlevel/lastexitcode based on build_success

If I run psake.ps1 on my continuous integration server and it doesn't result in a non-zero errorlevel somebody's going to have a false-positive at some point... In a basic test, ".\build.ps1 idontexist" the $lastexitcode was still zero. Similarly, running ".\build.cmd idontexist" is the same.

It looks like psake.psm1 is catching all throws, spitting them out in red, and setting $psake.build_success = false. This tells me that the errorlevel/$lastexitcode should be based on $psake.build_success or is an uncaught exception that should bubble out.

Hope you find this useful to the community.