-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcleanup.ps1
More file actions
37 lines (31 loc) · 1.32 KB
/
Copy pathcleanup.ps1
File metadata and controls
37 lines (31 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# cleanup.ps1 - Run once to finish repo cleanup
# Deletes backup files and the stale web/ directory
# Run from any directory: .\cleanup.ps1
$Root = "D:\Dev\repos\worldlabs-mcp"
Write-Host "worldlabs-mcp cleanup" -ForegroundColor Cyan
# 1. Delete stale web/ directory
$webDir = Join-Path $Root "web"
if (Test-Path $webDir) {
Remove-Item -Path $webDir -Recurse -Force -ErrorAction SilentlyContinue
if (Test-Path $webDir) {
Write-Host " web/ : LOCKED (close any apps using it, then re-run)" -ForegroundColor Yellow
} else {
Write-Host " web/ : deleted" -ForegroundColor Green
}
} else {
Write-Host " web/ : already gone" -ForegroundColor DarkGray
}
# 2. Delete all .bak and .backup files recursively
$staleFiles = Get-ChildItem -Path $Root -Recurse -Include "*.bak","*.backup" -File -ErrorAction SilentlyContinue
foreach ($f in $staleFiles) {
Remove-Item -Path $f.FullName -Force -ErrorAction SilentlyContinue
Write-Host " Deleted: $($f.Name)" -ForegroundColor DarkGray
}
# 3. Delete test_results.txt (temp output)
$testResults = Join-Path $Root "test_results.txt"
if (Test-Path $testResults) {
Remove-Item -Path $testResults -Force -ErrorAction SilentlyContinue
Write-Host " test_results.txt : deleted" -ForegroundColor DarkGray
}
Write-Host ""
Write-Host "Cleanup done." -ForegroundColor Cyan