/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
eng/scripts/mark-shipped.ps1
44 строки
1 KB
William Godbe
Mark API from 7 as shipped (#46069)
13 янв 2023, 23:21
Не верифицирован
13 янв 2023, 23:21
a403939
Код
Авторство
О чём код?
[CmdletBinding(PositionalBinding=$false)] param () Set-StrictMode -version 2.0 $ErrorActionPreference = "Stop" function MarkShipped([string]$dir) { $shippedFilePath = Join-Path $dir "PublicAPI.Shipped.txt" $shipped = @() $shipped += Get-Content $shippedFilePath $unshippedFilePath = Join-Path $dir "PublicAPI.Unshipped.txt" $unshipped = Get-Content $unshippedFilePath $removed = @() $removedPrefix = "*REMOVED*"; Write-Host "Processing $dir" foreach ($item in $unshipped) { if ($item.Length -gt 0) { if ($item.StartsWith($removedPrefix)) { $item = $item.Substring($removedPrefix.Length) $removed += $item } else { $shipped += $item } } } $shipped | Sort-Object -Unique |Where-Object { -not $removed.Contains($_) } | Out-File $shippedFilePath -Encoding Ascii Copy-Item eng/PublicAPI.empty.txt $unshippedFilePath } try { foreach ($file in Get-ChildItem -re -in "PublicApi.Shipped.txt") { $dir = Split-Path -parent $file MarkShipped $dir } } catch { Write-Host $_ Write-Host $_.Exception exit 1 }