File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ @ echo off
2
+ powershell -noprofile -executionPolicy Bypass -file " %~dp0 \mark-shipped.ps1"
Original file line number Diff line number Diff line change
1
+ [CmdletBinding (PositionalBinding = $false )]
2
+ param ()
3
+
4
+ Set-StrictMode - version 2.0
5
+ $ErrorActionPreference = " Stop"
6
+
7
+ function MarkShipped ([string ]$dir ) {
8
+ $shippedFilePath = Join-Path $dir " PublicAPI.Shipped.txt"
9
+ $shipped = Get-Content $shippedFilePath
10
+ if ($null -eq $shipped ) {
11
+ $shipped = @ ()
12
+ }
13
+
14
+ $unshippedFilePath = Join-Path $dir " PublicAPI.Unshipped.txt"
15
+ $unshipped = Get-Content $unshippedFilePath
16
+ $removed = @ ()
17
+ $removedPrefix = " *REMOVED*" ;
18
+ Write-Host " Processing $dir "
19
+
20
+ foreach ($item in $unshipped ) {
21
+ if ($item.Length -gt 0 ) {
22
+ if ($item.StartsWith ($removedPrefix )) {
23
+ $item = $item.Substring ($removedPrefix.Length )
24
+ $removed += $item
25
+ }
26
+ else {
27
+ $shipped += $item
28
+ }
29
+ }
30
+ }
31
+
32
+ $shipped | Sort-Object - Unique | Where-Object { -not $removed.Contains ($_ ) } | Out-File $shippedFilePath - Encoding Ascii
33
+ Copy-Item eng/ PublicAPI.empty.txt $unshippedFilePath
34
+ }
35
+
36
+ try {
37
+ foreach ($file in Get-ChildItem - re -in " PublicApi.Shipped.txt" ) {
38
+ $dir = Split-Path - parent $file
39
+ MarkShipped $dir
40
+ }
41
+ }
42
+ catch {
43
+ Write-Host $_
44
+ Write-Host $_.Exception
45
+ exit 1
46
+ }
You can’t perform that action at this time.
0 commit comments