-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcleanplaywright.ps1
More file actions
68 lines (63 loc) · 2.78 KB
/
Copy pathcleanplaywright.ps1
File metadata and controls
68 lines (63 loc) · 2.78 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
Write-Host "Cleaning Playwright installation..." -ForegroundColor Cyan
Write-Host ""
# Check if app is running
$process = Get-Process -Name "ShoutingIguana" -ErrorAction SilentlyContinue
if ($process) {
Write-Host "WARNING: ShoutingIguana is currently running!" -ForegroundColor Yellow
Write-Host "Please close the app and run this script again." -ForegroundColor Yellow
exit 1
}
# Clean Playwright browser cache (primary location - Windows default)
$playwrightCache = "$env:LOCALAPPDATA\ms-playwright"
Write-Host "Checking: $playwrightCache"
if (Test-Path $playwrightCache) {
try {
$items = Get-ChildItem -Path $playwrightCache -Recurse -ErrorAction SilentlyContinue | Measure-Object
Write-Host " Found $($items.Count) files/folders"
Remove-Item -Path $playwrightCache -Recurse -Force -ErrorAction Stop
Write-Host "SUCCESS: Removed Playwright cache" -ForegroundColor Green
}
catch {
Write-Host "ERROR: Failed to remove cache - $($_.Exception.Message)" -ForegroundColor Red
Write-Host "Try running PowerShell as Administrator" -ForegroundColor Yellow
}
} else {
Write-Host " No cache found (already clean)" -ForegroundColor Gray
}
# Check alternative location (Linux/Mac style on Windows)
$playwrightCache2 = "$env:USERPROFILE\.cache\ms-playwright"
Write-Host "Checking: $playwrightCache2"
if (Test-Path $playwrightCache2) {
try {
Remove-Item -Path $playwrightCache2 -Recurse -Force -ErrorAction Stop
Write-Host "SUCCESS: Removed Playwright cache (.cache)" -ForegroundColor Green
}
catch {
Write-Host "ERROR: Failed to remove cache - $($_.Exception.Message)" -ForegroundColor Red
}
} else {
Write-Host " No cache found" -ForegroundColor Gray
}
# Remove Shouting Iguana settings
$settingsFile = "$env:LOCALAPPDATA\ShoutingIguana\settings.json"
Write-Host "Checking: $settingsFile"
if (Test-Path $settingsFile) {
try {
Remove-Item -Path $settingsFile -Force -ErrorAction Stop
Write-Host "SUCCESS: Removed Shouting Iguana settings" -ForegroundColor Green
}
catch {
Write-Host "ERROR: Failed to remove settings - $($_.Exception.Message)" -ForegroundColor Red
}
} else {
Write-Host " No settings file found (already clean)" -ForegroundColor Gray
}
Write-Host ""
Write-Host "================================" -ForegroundColor Cyan
Write-Host "Cleanup complete!" -ForegroundColor Green
Write-Host "================================" -ForegroundColor Cyan
Write-Host ""
Write-Host "Next time you run the app:" -ForegroundColor White
Write-Host " 1. You'll see the loading overlay" -ForegroundColor Gray
Write-Host " 2. Playwright will download Chromium (~150MB)" -ForegroundColor Gray
Write-Host " 3. This takes 1-2 minutes depending on your connection" -ForegroundColor Gray