File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed
Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 66 [switch ] $SkipTests = $false
77)
88
9+ $ErrorActionPreference = " Stop"
10+
11+ function Exec ([scriptblock ] $Command )
12+ {
13+ $global :LastExitCode = 0
14+ & $Command
15+
16+ if ($global :LastExitCode -ne 0 )
17+ {
18+ Throw " Command failed: $Command "
19+ }
20+ }
21+
922Push-Location $PSScriptRoot
1023try
1124{
1225 Write-Output " Cleaning..."
13- dotnet clean -- configuration $Configuration -- verbosity minimal -- nologo
26+ Exec { dotnet clean -- configuration $Configuration -- verbosity minimal -- nologo }
1427 Get-ChildItem - Path src - Filter * .nupkg - Recurse | Remove-Item - Force
1528
1629 Write-Output " Restoring dependencies..."
17- dotnet restore
30+ Exec { dotnet restore }
1831
1932 Write-Output " Building..."
20- dotnet build -- configuration $Configuration -- verbosity minimal -- nologo - p:Version= $Version - p:PackageVersion= $PackageVersion
33+ Exec { dotnet build -- configuration $Configuration -- verbosity minimal -- no - restore -- nologo - p:Version= $Version - p:PackageVersion= $PackageVersion }
2134
2235 if (-not $SkipTests )
2336 {
2437 Write-Output " Running unit tests..."
25- dotnet test -- configuration $Configuration -- no- build -- nologo
38+ Exec { dotnet test -- configuration $Configuration -- no- build -- nologo }
2639 }
2740
2841 Write-Output " Creating artifacts..."
You can’t perform that action at this time.
0 commit comments