11 lines
596 B
PowerShell
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)"
|
|
}
|
|
}
|