From 16de2d8306aeb31085ed6137160868d3f8ca79df Mon Sep 17 00:00:00 2001 From: Scott Beddall <45376673+scbedd@users.noreply.github.com> Date: Tue, 9 Mar 2021 18:16:05 -0800 Subject: [PATCH] appropriately update the updatedocsciFn in Language-Settings. It would only update an EXISTING package w/ the appropriate version target for Preview. (#17220) --- eng/scripts/Language-Settings.ps1 | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/eng/scripts/Language-Settings.ps1 b/eng/scripts/Language-Settings.ps1 index 02eace224c2d..6fc2318c769c 100644 --- a/eng/scripts/Language-Settings.ps1 +++ b/eng/scripts/Language-Settings.ps1 @@ -242,20 +242,25 @@ function Update-python-CIConfig($pkgs, $ciRepo, $locationInDocRepo, $monikerId=$ $existingPackageDef.package_info.version = ">=$($releasingPkg.PackageVersion)" } else { - if ($def.version) { - $def.PSObject.Properties.Remove('version') + if ($existingPackageDef.package_info.version) { + $existingPackageDef.package_info.PSObject.Properties.Remove('version') } } } else { $newItem = New-Object PSObject -Property @{ - package_info = New-Object PSObject -Property @{ - prefer_source_distribution = "true" - install_type = "pypi" - name=$releasingPkg.PackageId - } - exclude_path = @("test*","example*","sample*","doc*") + package_info = New-Object PSObject -Property @{ + prefer_source_distribution = "true" + install_type = "pypi" + name=$releasingPkg.PackageId } + exclude_path = @("test*","example*","sample*","doc*") + } + + if ($releasingPkg.IsPrerelease) { + $newItem.package_info | Add-Member -NotePropertyName version -NotePropertyValue ">=$($releasingPkg.PackageVersion)" + } + $allJson.packages += $newItem } }