Fix beta builds with powershell release tool

This commit is contained in:
Jonathan White 2022-03-05 20:44:20 -05:00
parent abfebea4f2
commit 93624c3700
No known key found for this signature in database
GPG Key ID: 440FC65F2E0C6E01

View File

@ -37,7 +37,6 @@ param(
[Parameter(ParameterSetName = "merge", Mandatory, Position = 1)] [Parameter(ParameterSetName = "merge", Mandatory, Position = 1)]
[Parameter(ParameterSetName = "build", Mandatory, Position = 1)] [Parameter(ParameterSetName = "build", Mandatory, Position = 1)]
[Parameter(ParameterSetName = "sign", Mandatory, Position = 1)] [Parameter(ParameterSetName = "sign", Mandatory, Position = 1)]
[ValidatePattern("^[0-9]\.[0-9]\.[0-9]$")]
[string] $Version, [string] $Version,
[Parameter(ParameterSetName = "build", Mandatory)] [Parameter(ParameterSetName = "build", Mandatory)]
@ -258,7 +257,7 @@ if ($ExtraPath) {
$SourceDir = (Resolve-Path $SourceDir).Path $SourceDir = (Resolve-Path $SourceDir).Path
# Check format of -Version # Check format of -Version
if ($Version -notmatch "^\d+\.\d+\.\d+$") { if ($Version -notmatch "^\d+\.\d+\.\d+(-Beta\d*)?$") {
throw "Invalid format for -Version input" throw "Invalid format for -Version input"
} }
@ -349,7 +348,7 @@ if ($Merge) {
Remove-Item $OutDir -Recurse Remove-Item $OutDir -Recurse
} }
if ($Version -match "-beta\\d+$") { if ($Version -match "-beta\d*$") {
$CMakeOptions = "$CMakeOptions -DKEEPASSXC_BUILD_TYPE=PreRelease" $CMakeOptions = "$CMakeOptions -DKEEPASSXC_BUILD_TYPE=PreRelease"
} else { } else {
$CMakeOptions = "$CMakeOptions -DKEEPASSXC_BUILD_TYPE=Release" $CMakeOptions = "$CMakeOptions -DKEEPASSXC_BUILD_TYPE=Release"