13
13
$ExtensionVersion ,
14
14
15
15
[Parameter ()]
16
- [string ]
17
- $GalleryFileName = ' extensionsGallery.json' ,
16
+ [string [] ]
17
+ $GalleryFileName = ( ' extensionsGallery.json' , ' extensionsGallery-insider.json ' ) ,
18
18
19
19
[Parameter ()]
20
20
[string ]
@@ -213,26 +213,32 @@ function UpdateGalleryFile
213
213
[version ]
214
214
$ExtensionVersion ,
215
215
216
- [Parameter ()]
217
- [string ]
218
- $GalleryFilePath = ' ./extensionsGallery-insider.json '
216
+ [Parameter (Mandatory , ValueFromPipeline )]
217
+ [string [] ]
218
+ $GalleryFilePath
219
219
)
220
220
221
- # Create a new PowerShell extension entry
222
- $powershellEntry = NewPowerShellExtensionEntry - ExtensionVersion $ExtensionVersion
223
- $entryStr = ConvertTo-IndentedJson $powershellEntry - IndentChar " `t " - IndentWidth 1
221
+ process
222
+ {
223
+ foreach ($galleryFile in $GalleryFilePath )
224
+ {
225
+ # Create a new PowerShell extension entry
226
+ $powershellEntry = NewPowerShellExtensionEntry - ExtensionVersion $ExtensionVersion
227
+ $entryStr = ConvertTo-IndentedJson $powershellEntry - IndentChar " `t " - IndentWidth 1
224
228
225
- # Find the position in the existing file where the PowerShell extension should go
226
- $galleryFileContent = Get-Content - Raw $GalleryFilePath
227
- $span = FindPSExtensionJsonSpan - GalleryExtensionFileContent $galleryFileContent
228
- $startOffset = Get-StringOffsetFromSpan - String $galleryFileContent - EndLine $span.Start.Line - Column $span.Start.Column
229
- $endOffset = Get-StringOffsetFromSpan - String $galleryFileContent - EndLine $span.End.Line - StartLine $span.Start.Line - Column $span.End.Column - InitialOffset $startOffset
229
+ # Find the position in the existing file where the PowerShell extension should go
230
+ $galleryFileContent = Get-Content - Raw $GalleryFilePath
231
+ $span = FindPSExtensionJsonSpan - GalleryExtensionFileContent $galleryFileContent
232
+ $startOffset = Get-StringOffsetFromSpan - String $galleryFileContent - EndLine $span.Start.Line - Column $span.Start.Column
233
+ $endOffset = Get-StringOffsetFromSpan - String $galleryFileContent - EndLine $span.End.Line - StartLine $span.Start.Line - Column $span.End.Column - InitialOffset $startOffset
230
234
231
- # Create the new file contents with the inserted segment
232
- $newGalleryFileContent = New-StringWithSegment - String $galleryFileContent - NewSegment $entryStr - StartIndex $startOffset - EndIndex ($endOffset + 1 ) - AutoIndent
235
+ # Create the new file contents with the inserted segment
236
+ $newGalleryFileContent = New-StringWithSegment - String $galleryFileContent - NewSegment $entryStr - StartIndex $startOffset - EndIndex ($endOffset + 1 ) - AutoIndent
233
237
234
- # Write out the new entry
235
- Set-Content - Path $GalleryFilePath - Value $newGalleryFileContent - Encoding utf8NoBOM - NoNewline
238
+ # Write out the new entry
239
+ Set-Content - Path $GalleryFilePath - Value $newGalleryFileContent - Encoding utf8NoBOM - NoNewline
240
+ }
241
+ }
236
242
}
237
243
238
244
$repoLocation = Join-Path ([System.IO.Path ]::GetTempPath()) ' ads-temp-checkout'
@@ -243,13 +249,17 @@ $cloneParams = @{
243
249
CloneBranch = ' release/extensions'
244
250
CheckoutBranch = $branchName
245
251
Clobber = $true
252
+ PullUpstream = $true
253
+ UpdateOrigin = $true
246
254
Remotes = @ {
247
255
upstream = ' https://github.com/Microsoft/AzureDataStudio'
248
256
}
249
257
}
250
258
Copy-GitRepository @cloneParams
251
259
252
- UpdateGalleryFile - ExtensionVersion $ExtensionVersion - GalleryFilePath " $repoLocation /$GalleryFileName "
260
+ $GalleryFileName |
261
+ ForEach-Object { " $repoLocation /$_ " } |
262
+ UpdateGalleryFile - ExtensionVersion $ExtensionVersion
253
263
254
264
Submit-GitChanges - RepositoryLocation $repoLocation - File $GalleryFileName - Branch $branchName - Message " Update PS extension to v$ExtensionVersion "
255
265
0 commit comments