forked from josephwoodward/GlobalExceptionHandlerDotNet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ps1
More file actions
21 lines (17 loc) · 750 Bytes
/
Copy pathbuild.ps1
File metadata and controls
21 lines (17 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function Exec
{
[CmdletBinding()]
param(
[Parameter(Position=0,Mandatory=1)][scriptblock]$cmd,
[Parameter(Position=1,Mandatory=0)][string]$errorMessage = ($msgs.error_bad_command -f $cmd)
)
& $cmd
if ($lastexitcode -ne 0) {
throw ("Exec: " + $errorMessage)
}
}
if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse }
$revision = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$NULL -ne $env:APPVEYOR_BUILD_NUMBER];
$revision = "beta-{0:D4}" -f [convert]::ToInt32($revision, 10)
exec { & dotnet test .\src\GlobalExceptionHandler.Tests\GlobalExceptionHandler.Tests.csproj }
exec { & dotnet pack .\src\GlobalExceptionHandler -c Release -o .\artifacts --version-suffix=$revision }