Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes version prefix and suffix check in ValidateProjectVersionUpdated.ps1 #45

Merged
merged 2 commits into from
Nov 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions scripts/ValidateProjectVersionUpdated.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ Param(
[xml]$xmlDoc = Get-Content $projectPath

# Assumption: There is only one PropertyGroup
$versionPrefixString = $xmlDoc.Project.PropertyGroup.VersionPrefix
if($xmlDoc.Project.PropertyGroup.VersionSuffix){
$versionPrefixString = $versionPrefixString + "-" + $xmlDoc.Project.PropertyGroup.VersionSuffix
$versionPrefixString = $xmlDoc.Project.PropertyGroup.VersionPrefix[0]
peombwa marked this conversation as resolved.
Show resolved Hide resolved
if ($xmlDoc.Project.PropertyGroup.VersionSuffix.Count) {
$versionPrefixString = $versionPrefixString + "-" + $xmlDoc.Project.PropertyGroup.VersionSuffix[0]
}


Expand All @@ -47,7 +47,7 @@ Try {
$nugetIndex = Invoke-RestMethod -Uri $url -Method Get
}
Catch {
if ($_.ErrorDetails.Message && $_.ErrorDetails.Message.Contains("The specified blob does not exist.")) {
if ($_.ErrorDetails.Message -and $_.ErrorDetails.Message.Contains("The specified blob does not exist.")) {
Write-Host "No package exists. You will probably be publishing $packageName for the first time."
Exit # exit gracefully
}
Expand Down