Skip to content

Commit

Permalink
Mitigate relative path calculation error on multiple iterations
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljurek authored and azure-sdk committed Oct 12, 2021
1 parent 1e706fc commit 5073e79
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions eng/common/scripts/Save-Package-Properties.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,15 @@ function SetOutput($outputPath, $incomingPackageSpec) {
else
{
$outputObject = $incomingPackageSpec

# Set file paths to relative paths. Only do this if there is no existing
# package info json file as running this multiple times can create
# unexpected relative paths in some scenarios.
$outputObject.DirectoryPath = GetRelativePath $outputObject.DirectoryPath
$outputObject.ReadMePath = GetRelativePath $outputObject.ReadMePath
$outputObject.ChangeLogPath = GetRelativePath $outputObject.ChangeLogPath
}


if ($addDevVersion)
{
Expand All @@ -58,11 +65,6 @@ function SetOutput($outputPath, $incomingPackageSpec) {
$outputObject.DevVersion = $incomingPackageSpec.Version
}

# Set file paths to relative paths
$outputObject.DirectoryPath = GetRelativePath $outputObject.DirectoryPath
$outputObject.ReadMePath = GetRelativePath $outputObject.ReadMePath
$outputObject.ChangeLogPath = GetRelativePath $outputObject.ChangeLogPath

Set-Content `
-Path $outputPath `
-Value (ConvertTo-Json -InputObject $outputObject -Depth 100)
Expand Down

0 comments on commit 5073e79

Please sign in to comment.