Existing documentation URL(s)
The current documentation for deleting a project with too many deployments relies on a shell script workflow that works for Linux/macOS shells, but is not Windows-friendly as written. It also throws a "jq not found" error in WSL for me.
What changes are you suggesting?
Please add examples in tabs to the guide:
- Shell script (Linux/macOS)
- PowerShell
.ps1 (Windows)
$prod_id = ""
while ($true) {
$json = npx wrangler pages deployment list --project-name <PROJECT_NAME> --json 2>$null
$ids = ($json | ConvertFrom-Json) | Select-Object -ExpandProperty id
$to_delete = $ids | Where-Object { $_ -ne $prod_id }
if (-not $to_delete) {
Write-Host "Done. Production: $prod_id"
break
}
Write-Host "Deleting $(@($to_delete).Count) deployments..."
foreach ($id in $to_delete) {
$output = npx wrangler pages deployment delete $id --project-name <PROJECT_NAME> --force 2>&1
if ($output -notmatch "Successfully deleted") {
if ($output -match "active production deployment") {
$prod_id = $id
}
}
}
}
This would make the guide much more accessible for Windows users.
Additional information
I could make a PR, but I don't think I've got the time anytime soon. Maybe someone else is faster than me. If not, I will do it.
Existing documentation URL(s)
The current documentation for deleting a project with too many deployments relies on a shell script workflow that works for Linux/macOS shells, but is not Windows-friendly as written. It also throws a "jq not found" error in WSL for me.
What changes are you suggesting?
Please add examples in tabs to the guide:
.ps1(Windows)This would make the guide much more accessible for Windows users.
Additional information
I could make a PR, but I don't think I've got the time anytime soon. Maybe someone else is faster than me. If not, I will do it.