From 3ef822756d19320436a873eb8ce5f8048f2b8272 Mon Sep 17 00:00:00 2001 From: Josh Schreuder Date: Thu, 24 Aug 2017 14:45:19 +1000 Subject: [PATCH] Fix version suffix on dotnet pack --- Build.ps1 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Build.ps1 b/Build.ps1 index 55db40f..41ed55e 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -16,7 +16,7 @@ $commitHash = $(git rev-parse --short HEAD) $buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""] echo "build: Package version suffix is $suffix" -echo "build: Build version suffix is $buildSuffix" +echo "build: Build version suffix is $buildSuffix" foreach ($src in ls src/*) { Push-Location $src @@ -24,8 +24,14 @@ foreach ($src in ls src/*) { echo "build: Packaging project in $src" & dotnet build -c Release --version-suffix=$buildSuffix - & dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix --no-build - if($LASTEXITCODE -ne 0) { exit 1 } + if($suffix -ne "") { + & dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix --no-build + } + else { + & dotnet pack -c Release -o ..\..\artifacts --no-build + } + + if($LASTEXITCODE -ne 0) { exit 1 } Pop-Location }