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

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+7 −1
Split
View
@@ -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
@@ -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
+}