Skip to content
This repository was archived by the owner on Nov 28, 2023. It is now read-only.

Commit bf3333d

Browse files
committed
Wrap external exe calls in exec{} so non zero exit codes fail the build.
1 parent 87c0475 commit bf3333d

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

default.ps1

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ properties {
4545
task Default -depends Pack
4646

4747
task Clean -depends SetVersion {
48-
msbuild "$slnFile" /t:Clean /p:Configuration=$configuration
48+
exec { msbuild "$slnFile" /t:Clean /p:Configuration=$configuration }
4949
}
5050

5151
task Compile -depends Clean {
52-
msbuild "$slnFile" /p:Configuration=$configuration
52+
exec { msbuild "$slnFile" /p:Configuration=$configuration }
5353
}
5454

5555
task Test -depends Compile {
56-
.$xunitRunner "$testDll"
56+
exec { .$xunitRunner "$testDll" }
5757
}
5858

5959
task Pack -depends Test {
@@ -67,21 +67,21 @@ task Pack -depends Test {
6767
$versionSwitch = "-Version $completeVersionNumber"
6868
}
6969

70-
invoke-expression "& '$nugetExe' pack '$csprojFile' -Symbols -Properties Configuration=$configuration -OutputDirectory '$nugetOutputDir' $versionSwitch"
70+
exec { invoke-expression "& '$nugetExe' pack '$csprojFile' -Symbols -Properties Configuration=$configuration -OutputDirectory '$nugetOutputDir' $versionSwitch"
71+
}
7172
}
7273

7374
task SetVersion {
74-
75-
$completeVersionNumber = Get-VersionNumber
75+
$completeVersionNumber = Get-VersionNumber
7676

77-
if(![string]::IsNullOrEmpty($buildNumber))
78-
{
79-
#running in TeamCity
80-
Write-Host "##teamcity[buildNumber '$completeVersionNumber']"
81-
}
77+
if(![string]::IsNullOrEmpty($buildNumber))
78+
{
79+
#running in TeamCity
80+
Write-Host "##teamcity[buildNumber '$completeVersionNumber']"
81+
}
8282

83-
Write-Host "Setting version to $completeVersionNumber"
84-
85-
Set-Version $completeVersionNumber
83+
Write-Host "Setting version to $completeVersionNumber"
84+
85+
Set-Version $completeVersionNumber
8686
}
8787

0 commit comments

Comments
 (0)