Permalink
Browse files

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.
  • Loading branch information...
1 parent 0d87ff3 commit 642901f8430453b0da7472f7e5620e152b7abc6a @rbevers committed Aug 15, 2012
Showing with 7 additions and 1 deletion.
  1. +4 −1 psake.cmd
  2. +3 −0 psake.ps1
View
5 psake.cmd
@@ -4,7 +4,10 @@ if '%1'=='/?' goto help
if '%1'=='-help' goto help
if '%1'=='-h' goto help
-powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0\psake.ps1' %*; if ($psake.build_success -eq $false) { exit 1 } else { exit 0 }"
+powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0\psake.ps1' %*"
+if errorlevel 1 (
+ exit /b 1
+)
goto :eof
:help
View
3 psake.ps1
@@ -44,3 +44,6 @@ if (-not(test-path $buildFile)) {
}
invoke-psake $buildFile $taskList $framework $docs $parameters $properties $initialization $nologo
+if (-not($psake.build_success)) {
+ exit 1
+}

0 comments on commit 642901f

Please sign in to comment.