-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcleanup.ps1
More file actions
79 lines (70 loc) · 2.95 KB
/
cleanup.ps1
File metadata and controls
79 lines (70 loc) · 2.95 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Cleanup script for database-expectations-python project
Write-Host "======================================================================"
Write-Host "DATABASE EXPECTATIONS - CLEANUP SCRIPT"
Write-Host "======================================================================"
Write-Host ""
`$cleaned = 0
# Clean database files
Write-Host "Cleaning database files..." -ForegroundColor Yellow
`$dbFiles = Get-ChildItem -Path . -Filter "*.db" -File -ErrorAction SilentlyContinue
if (`$dbFiles) {
`$dbFiles | Remove-Item -Force
Write-Host " [OK] Removed `$(`$dbFiles.Count) database file(s)" -ForegroundColor Green
`$cleaned += `$dbFiles.Count
} else {
Write-Host " [SKIP] No database files to clean" -ForegroundColor Gray
}
# Clean coverage data
Write-Host "Cleaning coverage data..." -ForegroundColor Yellow
if (Test-Path ".coverage") {
Remove-Item ".coverage" -Force
Write-Host " [OK] Removed .coverage file" -ForegroundColor Green
`$cleaned++
} else {
Write-Host " [SKIP] No coverage data to clean" -ForegroundColor Gray
}
# Clean Great Expectations directory
Write-Host "Cleaning Great Expectations directory..." -ForegroundColor Yellow
if (Test-Path "gx") {
Remove-Item "gx" -Recurse -Force
Write-Host " [OK] Removed gx/ directory" -ForegroundColor Green
`$cleaned++
} else {
Write-Host " [SKIP] No gx/ directory to clean" -ForegroundColor Gray
}
# Clean pytest cache
Write-Host "Cleaning pytest cache..." -ForegroundColor Yellow
if (Test-Path ".pytest_cache") {
Remove-Item ".pytest_cache" -Recurse -Force
Write-Host " [OK] Removed .pytest_cache/ directory" -ForegroundColor Green
`$cleaned++
} else {
Write-Host " [SKIP] No pytest cache to clean" -ForegroundColor Gray
}
# Clean Python cache
Write-Host "Cleaning Python cache files..." -ForegroundColor Yellow
`$pycache = Get-ChildItem -Path . -Filter "__pycache__" -Directory -Recurse -ErrorAction SilentlyContinue
if (`$pycache) {
`$pycache | Remove-Item -Recurse -Force
Write-Host " [OK] Removed `$(`$pycache.Count) __pycache__ directories" -ForegroundColor Green
`$cleaned += `$pycache.Count
} else {
Write-Host " [SKIP] No __pycache__ directories to clean" -ForegroundColor Gray
}
# Clean .pyc files
`$pycFiles = Get-ChildItem -Path . -Filter "*.pyc" -File -Recurse -ErrorAction SilentlyContinue
if (`$pycFiles) {
`$pycFiles | Remove-Item -Force
Write-Host " [OK] Removed `$(`$pycFiles.Count) .pyc file(s)" -ForegroundColor Green
`$cleaned += `$pycFiles.Count
} else {
Write-Host " [SKIP] No .pyc files to clean" -ForegroundColor Gray
}
Write-Host ""
Write-Host "======================================================================"
if (`$cleaned -eq 0) {
Write-Host "[SUCCESS] Project already clean - no files removed" -ForegroundColor Green
} else {
Write-Host "[SUCCESS] Cleanup complete - removed `$cleaned item(s)" -ForegroundColor Green
}
Write-Host "======================================================================"