From 524edff2021b220de4f0ed9672718baad983ad60 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 6 Oct 2021 09:33:34 -0700 Subject: [PATCH] Sync eng/common directory with azure-sdk-tools for PR 2064 (#18059) --- .../pipelines/templates/steps/update-docsms-metadata.yml | 2 +- eng/common/scripts/Update-DocsMsMetadata.ps1 | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/eng/common/pipelines/templates/steps/update-docsms-metadata.yml b/eng/common/pipelines/templates/steps/update-docsms-metadata.yml index 341169b37348..5b4a92f3a6ca 100644 --- a/eng/common/pipelines/templates/steps/update-docsms-metadata.yml +++ b/eng/common/pipelines/templates/steps/update-docsms-metadata.yml @@ -75,7 +75,7 @@ steps: DefaultBranchVariableName: TargetBranchName - pwsh: | - $packageInfoJson = '${{ convertToJson(parameters.PackageInfoLocations) }}'.Trim('"') + $packageInfoJson = '${{ convertToJson(parameters.PackageInfoLocations) }}'.Trim('"').Replace("\\", "/") $packageInfoLocations = ConvertFrom-Json $packageInfoJson ${{ parameters.ScriptDirectory }}/Update-DocsMsMetadata.ps1 ` -PackageInfoJsonLocations $packageInfoLocations ` diff --git a/eng/common/scripts/Update-DocsMsMetadata.ps1 b/eng/common/scripts/Update-DocsMsMetadata.ps1 index a243691469af..774d2b0a606a 100644 --- a/eng/common/scripts/Update-DocsMsMetadata.ps1 +++ b/eng/common/scripts/Update-DocsMsMetadata.ps1 @@ -62,6 +62,7 @@ function GetAdjustedReadmeContent($ReadmeContent, $PackageInfo, $PackageMetadata # Generate the release tag for use in link substitution $tag = "$($PackageInfo.Name)_$($PackageInfo.Version)" + Write-Host "The tag of package: $tag" $date = Get-Date -Format "MM/dd/yyyy" @@ -97,9 +98,13 @@ ms.service: $service } function UpdateDocsMsMetadataForPackage($packageInfoJsonLocation) { + if (!(Test-Path $packageInfoJsonLocation)) { + LogWarning "Package metadata not found for $packageInfoJsonLocation" + return + } + $packageInfoJson = Get-Content $packageInfoJsonLocation -Raw $packageInfo = ConvertFrom-Json $packageInfoJson - $originalVersion = [AzureEngSemanticVersion]::ParseVersionString($packageInfo.Version) if ($packageInfo.DevVersion) { # If the package is of a dev version there may be language-specific needs to