Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Commit

Permalink
Exit script of either of the dotnet task fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
damianh committed Jan 4, 2019
1 parent cdea10c commit 61dd804
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
function Run-Task
{
param(
[scriptblock] $block
)

& $block

if($LASTEXITCODE -ne 0)
{
exit $LASTEXITCODE
}
}

if (-not (Test-Path env:APPVEYOR_BUILD_NUMBER)) { $env:APPVEYOR_BUILD_NUMBER = '0' }
$suffix = "build." + $env:APPVEYOR_BUILD_NUMBER
$TOOLS_DIR = Join-Path $PSScriptRoot "tools"
$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe"

dotnet build src\LibLog.sln -c Release
dotnet test src\LibLog.Tests -c Release --no-build
Run-Task { dotnet build src\LibLog.sln -c Release }
Run-Task { dotnet test src\LibLog.Tests -c Release --no-build }

Get-ChildItem ./src/*.pp -Recurse | ForEach-Object { Remove-Item $_ }

Expand Down

0 comments on commit 61dd804

Please sign in to comment.