Skip to content

Commit

Permalink
Fixed errorlevel/$lastexitcode handling based on $psake.build_success…
Browse files Browse the repository at this point in the history
…, so that it works consistently for psake.ps1 and psake.cmd in both PowerShell window or Command Prompt window.
  • Loading branch information
rbevers committed Aug 15, 2012
1 parent 0d87ff3 commit 642901f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion psake.cmd
Expand Up @@ -4,7 +4,10 @@ if '%1'=='/?' goto help
if '%1'=='-help' goto help if '%1'=='-help' goto help
if '%1'=='-h' 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 goto :eof


:help :help
Expand Down
3 changes: 3 additions & 0 deletions psake.ps1
Expand Up @@ -44,3 +44,6 @@ if (-not(test-path $buildFile)) {
} }


invoke-psake $buildFile $taskList $framework $docs $parameters $properties $initialization $nologo 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.