Files
vpn-dns-gateway/demo/tikzrefinery/documents/assets/undo-redo-2026-11-24/cleanup.ps1
T
vsun1 27b82c169e
vpn-dns-gateway/pipeline/head This commit looks good
vpn-dns-gateway/pipeline/pr-main This commit looks good
Add frozen TikZRefinery demo baseline and build pipeline
2026-11-25 22:46:33 -05:00

30 lines
1.6 KiB
PowerShell

$ErrorActionPreference = 'Stop'
$workspace = [IO.Path]::GetFullPath('C:\Users\vince\Documents\Projects\TikZRefinery')
$scratch = [IO.Path]::GetFullPath((Join-Path $workspace 'work\undo-redo-package'))
if ($scratch -ne (Join-Path $workspace 'work\undo-redo-package') -or
!$scratch.StartsWith($workspace + '\work\', [StringComparison]::OrdinalIgnoreCase)) {
throw 'Unexpected cleanup target'
}
$required = @('code\packages\0.1.4-alpha\TikZRefinery.exe',
'documents\TikZRefinery.pdf','documents\TikZRefinery-Developers-Edition.pdf',
'code\tests\evidence\undo-redo-2026-11-24\prior-uncommitted.patch',
'documents\assets\undo-redo-2026-11-24\checks.json')
foreach ($relative in $required) {
if (!(Test-Path -LiteralPath (Join-Path $workspace $relative) -PathType Leaf)) { throw "Missing $relative" }
}
$items = @(Get-ChildItem -LiteralPath $scratch -Recurse -File)
$bytes = ($items | Measure-Object -Property Length -Sum).Sum
$count = $items.Count
Remove-Item -LiteralPath $scratch -Recurse -Force
foreach ($relative in $required) {
if (!(Test-Path -LiteralPath (Join-Path $workspace $relative) -PathType Leaf)) { throw "Missing after cleanup: $relative" }
}
$record = [ordered]@{
removed = $scratch
removedFiles = $count
reclaimedBytes = $bytes
retained = 'Runnable package, both reports/archives, source, prior-work patch, native captures, compact document review, final logs and incremental Debug build'
}
$record | ConvertTo-Json | Set-Content -LiteralPath (Join-Path $workspace 'documents\assets\undo-redo-2026-11-24\cleanup.json') -Encoding utf8
$record | ConvertTo-Json