Skip to content

Commit

Permalink
Resolve #34
Browse files Browse the repository at this point in the history
  • Loading branch information
nightroman committed Sep 11, 2016
1 parent 5df71fa commit 90ccfec
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Invoke-Build.ps1
Expand Up @@ -221,7 +221,7 @@ catch {
}

#.ExternalHelp Invoke-Build-Help.xml
function Get-BuildVersion {[Version]'3.0.1'}
function Get-BuildVersion {[Version]'3.0.2'}

function *My {
$_.InvocationInfo.ScriptName -match '[\\/]Invoke-Build\.ps1$'
Expand Down Expand Up @@ -665,6 +665,7 @@ try {
. *UC Exit-Build
}
${*r} = 1
exit 0
}
catch {
${*r} = 2
Expand Down
2 changes: 1 addition & 1 deletion InvokeBuild/InvokeBuild.psd1
@@ -1,6 +1,6 @@

@{
ModuleVersion = '3.0.1'
ModuleVersion = '3.0.2'
ModuleToProcess = 'InvokeBuild.psm1'
GUID = 'a0319025-5f1f-47f0-ae8d-9c7e151a5aae'
Author = 'Roman Kuzmin'
Expand Down
4 changes: 4 additions & 0 deletions Release-Notes.md
@@ -1,6 +1,10 @@

# Invoke-Build Release Notes

## v3.0.2

Use `exit 0` on success (#34).

## v3.0.1

Invoke-Build is cross-platform with PowerShell v6.0.0-alpha.
Expand Down
15 changes: 15 additions & 0 deletions Tests/Fixed.test.ps1
Expand Up @@ -193,3 +193,18 @@ task InvalidCheckpointOnResume {
($r = try {Invoke-Build -Checkpoint $BuildFile -Resume} catch {$_})
equals "$r" 'Invalid checkpoint file?'
}

# Synopsis: #34, VSTS expects $LASTEXITCODE 0 on success
task ExitCodeOnSuccessShouldBe0 {
Set-Content z.ps1 {
task CmdExitCode42 {
exec {cmd.exe /c exit 42} 42
equals $LASTEXITCODE 42
}
}

Invoke-Build CmdExitCode42 z.ps1
equals $LASTEXITCODE 0

Remove-Item z.ps1
}

0 comments on commit 90ccfec

Please sign in to comment.