vcpkg/scripts/azure-pipelines/Create-FormatDiff.ps1
nicole mazzuca 30767175d5
[vcpkg ci] upload diff from clang-format to artifacts (#15141)
* [vcpkg ci] upload diff from clang-format to artifacts

this allows people who do not have access to clang-format to format their code via diff
2020-12-16 13:14:35 -08:00

20 lines
594 B
PowerShell

[CmdletBinding(PositionalBinding=$False)]
Param(
[Parameter(Mandatory=$True)]
[String]$DiffFile
)
Start-Process -FilePath 'git' -ArgumentList 'diff' `
-NoNewWindow -Wait `
-RedirectStandardOutput $DiffFile
if (0 -ne (Get-Item -LiteralPath $DiffFile).Length)
{
$msg = @(
'The formatting of the files in the repo were not what we expected,',
'or the documentation was not regenerated.',
'Please access the diff from format.diff in the build artifacts,'
'and apply the patch with `git apply`'
)
Write-Error ($msg -join "`n")
throw
}