aboutsummaryrefslogtreecommitdiff
path: root/scripts/azure-pipelines/Create-FormatDiff.ps1
diff options
context:
space:
mode:
authornicole mazzuca <mazzucan@outlook.com>2020-12-16 13:14:35 -0800
committerGitHub <noreply@github.com>2020-12-16 13:14:35 -0800
commit30767175d52d9667ce37d96fe1a7d1438dc94ea1 (patch)
tree982999e2593b2d8bc580e25ef9f50f84d30cb6be /scripts/azure-pipelines/Create-FormatDiff.ps1
parentd52fbe6a45c9ee0736edb42be4d688ae858bc215 (diff)
downloadvcpkg-30767175d52d9667ce37d96fe1a7d1438dc94ea1.tar.gz
vcpkg-30767175d52d9667ce37d96fe1a7d1438dc94ea1.zip
[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
Diffstat (limited to 'scripts/azure-pipelines/Create-FormatDiff.ps1')
-rw-r--r--scripts/azure-pipelines/Create-FormatDiff.ps120
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/azure-pipelines/Create-FormatDiff.ps1 b/scripts/azure-pipelines/Create-FormatDiff.ps1
new file mode 100644
index 000000000..599118089
--- /dev/null
+++ b/scripts/azure-pipelines/Create-FormatDiff.ps1
@@ -0,0 +1,20 @@
+[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
+} \ No newline at end of file