Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fix for psake.ps1 and psake.cmd errorlevel/lastexitcode based on build_success #47

wants to merge 1 commit into


None yet
2 participants

rbevers commented Aug 15, 2012

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.

@rbevers rbevers Fixed errorlevel/$lastexitcode handling based on $psake.build_success…
…, so that it works consistently for psake.ps1 and psake.cmd in both PowerShell window or Command Prompt window.

JamesKovacs commented Jan 18, 2013

This appears to have been resolved in a similar manner with another commit. If it is still an issue, please update your pull request and reopen. (Apologies for not reviewing this earlier. For some reason, I stopped getting notifications. My bad.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment