Files
git.stella-ops.org/fix-asynclifetime.ps1
StellaOps Bot e6c47c8f50 save progress
2025-12-28 23:49:56 +02:00

11 lines
596 B
PowerShell

Get-ChildItem -Path "src" -Filter "*.cs" -Recurse | ForEach-Object {
$content = Get-Content $_.FullName -Raw -ErrorAction SilentlyContinue
if ($content -match 'IAsyncLifetime') {
$content = $content -replace 'public Task InitializeAsync\(\)', 'public ValueTask InitializeAsync()'
$content = $content -replace 'public Task DisposeAsync\(\)', 'public ValueTask DisposeAsync()'
$content = $content -replace '=> Task\.CompletedTask;', '=> ValueTask.CompletedTask;'
Set-Content $_.FullName $content -NoNewline
Write-Host "Fixed: $($_.FullName)"
}
}