save progress
This commit is contained in:
10
fix-asynclifetime.ps1
Normal file
10
fix-asynclifetime.ps1
Normal file
@@ -0,0 +1,10 @@
|
||||
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)"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user