From 9aeb171543f7e8c97a6c0b302c6582e4229ef416 Mon Sep 17 00:00:00 2001 From: Leon <76940360+lktraser@users.noreply.github.com> Date: Thu, 5 Sep 2024 10:54:10 +0200 Subject: [PATCH] #3590 Get-BcNuGetPackageId uses wrong formatting for version (#3610) Get-BcNuGetPackageId uses wrong formatting for version . instead of - #3590 Co-authored-by: Freddy Kristiansen --- NuGet/Get-BcNuGetPackageId.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NuGet/Get-BcNuGetPackageId.ps1 b/NuGet/Get-BcNuGetPackageId.ps1 index 99fb9aac..9a70ffb7 100644 --- a/NuGet/Get-BcNuGetPackageId.ps1 +++ b/NuGet/Get-BcNuGetPackageId.ps1 @@ -45,7 +45,9 @@ function Get-BcNuGetPackageId { if ($nname -eq '') { throw "App name is invalid: '$name'" } if ($npublisher -eq '') { throw "App publisher is invalid: '$publisher'" } - $packageIdTemplate = $packageIdTemplate.replace('{id}',$id).replace('{publisher}',$npublisher).replace('{tag}',$tag).replace('{version}',$version).replace('..','.').TrimEnd('.') + $version = $version.Replace('..', '.').TrimEnd('.').Replace('.', '-'); + + $packageIdTemplate = $packageIdTemplate.replace('{id}',$id).replace('{publisher}',$npublisher).replace('{tag}',$tag).replace('{version}',$version) # Max. Length of NuGet Package Id is 100 - we shorten the name part of the id if it is too long $packageId = $packageIdTemplate.replace('{name}',$nname) if ($packageId.Length -ge 100) {