From 79a7fe60ea70e73932518e6d2f85221a7bc5641c Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Thu, 13 Jun 2024 14:27:41 +0300 Subject: [PATCH 1/2] Fixes validation script --- scripts/ValidateProjectVersionUpdated.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ValidateProjectVersionUpdated.ps1 b/scripts/ValidateProjectVersionUpdated.ps1 index f654389..6d70816 100644 --- a/scripts/ValidateProjectVersionUpdated.ps1 +++ b/scripts/ValidateProjectVersionUpdated.ps1 @@ -51,12 +51,12 @@ Catch { Write-Host "No package exists. You will probably be publishing $packageName for the first time." Exit # exit gracefully } - + Write-Host $_ Exit 1 } -$currentPublishedVersion = [System.Management.Automation.SemanticVersion]$nugetIndex.items[0].upper +$currentPublishedVersion = [System.Management.Automation.SemanticVersion]$nugetIndex.items[$nugetIndex.items.Count - 1].upper # Validate that the version number has been updated. if ($currentProjectVersion -le $currentPublishedVersion) { From b48dbd4b4d5708ad30400326323c2511a938eec3 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Thu, 13 Jun 2024 16:06:54 +0300 Subject: [PATCH 2/2] Address Comments --- scripts/ValidateProjectVersionUpdated.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ValidateProjectVersionUpdated.ps1 b/scripts/ValidateProjectVersionUpdated.ps1 index 6d70816..fd77e1a 100644 --- a/scripts/ValidateProjectVersionUpdated.ps1 +++ b/scripts/ValidateProjectVersionUpdated.ps1 @@ -56,7 +56,7 @@ Catch { Exit 1 } -$currentPublishedVersion = [System.Management.Automation.SemanticVersion]$nugetIndex.items[$nugetIndex.items.Count - 1].upper +$currentPublishedVersion = $nugetIndex.items | Select-Object -ExpandProperty upper | ForEach-Object { [System.Management.Automation.SemanticVersion]$_ } | sort-object | Select-Object -Last 1 # Validate that the version number has been updated. if ($currentProjectVersion -le $currentPublishedVersion) {