-
-
Notifications
You must be signed in to change notification settings - Fork 229
Expand file tree
/
Copy pathaccept-verifier-changes.ps1
More file actions
23 lines (18 loc) · 851 Bytes
/
accept-verifier-changes.ps1
File metadata and controls
23 lines (18 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Similar to `dotnet verify accept` but doesn't create new runtime-specific ".verified" files if a common one exists.
param([switch] $DryRun)
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$receivedFiles = Get-ChildItem . -Recurse -File -Include "*.received.txt"
$receivedFiles | ForEach-Object {
$nameWithRuntime = ($_.BaseName.Split(".") | Select-Object -SkipLast 1) -join "."
$nameWithoutRuntime = ($_.BaseName.Split(".") | Select-Object -SkipLast 2) -join "."
$ext = ".verified.txt"
$targetFile = (Test-Path "$($_.Directory)/$nameWithoutRuntime$ext") `
? "$($_.Directory)/$nameWithoutRuntime$ext" `
: "$($_.Directory)/$nameWithRuntime$ext"
Write-Host "Updating $($targetFile.Replace((Get-Item .).FullName, ''))"
if (-not ($DryRun))
{
Move-Item $_ $targetFile -Force
}
}