Skip to content

Commit adaf77d

Browse files
authored
Resolve issue with fully disabled snippets (Azure#48998)
1 parent 029687b commit adaf77d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

eng/scripts/Build-Snippets.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ Set-StrictMode -Version 4
1818
$TargetProjects = $ProjectNames -split ","
1919
$RepoRoot = Resolve-Path (Join-Path "$PSScriptRoot" ".." "..")
2020

21-
$snippetEnabledProjects = (Get-ChildItem -Recurse "$PackageInfoFolder" *.json `
21+
$snippetEnabledProjects = Get-ChildItem -Recurse "$PackageInfoFolder" *.json `
2222
| Foreach-Object { Get-Content -Raw -Path $_.FullName | ConvertFrom-Json } `
2323
| Where-Object { $_.ArtifactName -in $TargetProjects -and $_.CIParameters.BuildSnippets -eq $true }
24-
| ForEach-Object { $_.ArtifactName }) -join ","
24+
| ForEach-Object { $_.ArtifactName }
2525

26-
$scopedFile = Write-PkgInfoToDependencyGroupFile -OutputPath "$RepoRoot" -PackageInfoFolder $PackageInfoFolder -ProjectNames $snippetEnabledProjects
26+
if ($snippetEnabledProjects) {
27+
$scopedFile = Write-PkgInfoToDependencyGroupFile -OutputPath "$RepoRoot" -PackageInfoFolder $PackageInfoFolder -ProjectNames $snippetEnabledProjects
2728

28-
Write-Host "Writing project list to $scopedFile"
29-
Write-Host (Get-Content -Raw -Path $scopedFile)
29+
Write-Host "Writing project list to $scopedFile"
30+
Write-Host (Get-Content -Raw -Path $scopedFile)
3031

31-
if ($snippetEnabledProjects) {
3232
dotnet build eng/service.proj -warnaserror `
3333
/t:rebuild `
3434
/p:DebugType=none `

0 commit comments

Comments
 (0)