@@ -116,23 +116,6 @@ function FindPackageJsonVersionSpan
116116 throw ' Did not find package.json version field'
117117}
118118
119- function FindRequiredPsesVersionSpan
120- {
121- param (
122- [Parameter (Mandatory )]
123- [string ]
124- $MainTsContent
125- )
126-
127- $pattern = [regex ]' const\s+requiredEditorServicesVersion\s+=\s+"(.*)"'
128- $versionGroup = $pattern.Match ($MainTsContent ).Groups[1 ]
129-
130- return @ {
131- Start = $versionGroup.Index
132- End = $versionGroup.Index + $versionGroup.Length
133- }
134- }
135-
136119function FindVstsBuildVersionSpan
137120{
138121 param (
@@ -150,27 +133,6 @@ function FindVstsBuildVersionSpan
150133 }
151134}
152135
153- function UpdateMainTsPsesVersion
154- {
155- param (
156- [Parameter (Mandatory )]
157- [string ]
158- $MainTsPath ,
159-
160- [Parameter (Mandatory )]
161- [version ]
162- $Version
163- )
164-
165- $mainTsContent = Get-Content - Raw $MainTsPath
166- $mainTsVersionSpan = FindRequiredPsesVersionSpan $mainTsContent
167- $newMainTsContent = New-StringWithSegment - String $mainTsContent - NewSegment $Version - StartIndex $mainTsVersionSpan.Start - EndIndex $mainTsVersionSpan.End
168- if ($newMainTsContent -ne $mainTsContent )
169- {
170- Set-Content - Path $MainTsPath - Value $newMainTsContent - Encoding utf8NoBOM - NoNewline
171- }
172- }
173-
174136function UpdateDockerFileVersion
175137{
176138 param (
@@ -247,16 +209,12 @@ if (-not $PRDescription)
247209}
248210
249211# Get the marketplace/non-semver versions for various files
250- $psesVersion = Get-VersionFromSemVer - SemVer $NewVersion
251212$marketPlaceVersion = GetMarketplaceVersionFromSemVer - SemVer $NewVersion
252213
253214# Finally create the new package.json file
254215$newPkgJsonContent = New-StringWithSegment - String $packageJson - NewSegment $NewVersion - StartIndex $pkgJsonVersionOffsetSpan.Start - EndIndex $pkgJsonVersionOffsetSpan.End
255216Set-Content - Path $paths.packageJson - Value $newPkgJsonContent - Encoding utf8NoBOM - NoNewline
256217
257- # Create the new content for the main.ts required version file
258- UpdateMainTsPsesVersion - MainTsPath $paths.mainTs - Version $psesVersion
259-
260218# Create the new content for the VSTS dockerfile
261219UpdateDockerFileVersion - DockerFilePath $paths.vstsDockerFile - Version $marketPlaceVersion
262220
0 commit comments