Skip to content

Commit 14be138

Browse files
committed
build.ps1 - Stip off -pre from Assembly version
1 parent b034d1c commit 14be138

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

build.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,14 @@ if (Test-Path Env:\APPVEYOR_BUILD_VERSION)
3636
if ($env:APPVEYOR_REPO_TAG -eq "True")
3737
{
3838
$Version = "$env:APPVEYOR_REPO_TAG_NAME".Substring(1) # trim leading "v"
39-
$AssemblyVersion = $Version
39+
$AssemblyVersion = $Version
40+
#Stip the -pre
41+
if($AssemblyVersion.Contains("-pre"))
42+
{
43+
$AssemblyVersion = $AssemblyVersion.Substring(0, $AssemblyVersion.IndexOf("-pre"))
44+
}
4045
Write-Diagnostic "Setting Version based on tag to $Version"
41-
Write-Diagnostic "Setting AssemblyVersion based on tag to $AssemblyVersion"
46+
Write-Diagnostic "Setting AssemblyVersion based on tag to $AssemblyVersion"
4247
}
4348

4449
# https://github.com/jbake/Powershell_scripts/blob/master/Invoke-BatchFile.ps1

0 commit comments

Comments
 (0)