aboutsummaryrefslogtreecommitdiff
path: root/scripts/azure-pipelines/Create-PRDiff.ps1
diff options
context:
space:
mode:
authorBilly O'Neal <bion@microsoft.com>2021-02-04 10:15:44 -0800
committerGitHub <noreply@github.com>2021-02-04 10:15:44 -0800
commitaa60b7efa56a83ead743718941d8b320ef4a05af (patch)
treedb9f9ebd6fa37598b2f5f2ad564eb858cdeddcb0 /scripts/azure-pipelines/Create-PRDiff.ps1
parentf226416d2eafc495dd03572cb61542fb1670ffdc (diff)
downloadvcpkg-aa60b7efa56a83ead743718941d8b320ef4a05af.tar.gz
vcpkg-aa60b7efa56a83ead743718941d8b320ef4a05af.zip
[vcpkg] Download vcpkg.exe rather than building it in bootstrap on Windows. (#15474)
This reduces bootstrap cost for Windows customers, resolving the issue initially submitted as #12502 . The `toolsrc` tree was extracted to https://github.com/microsoft/vcpkg-tool. `bootstrap.sh` was changed to download the right source tarball, extract, and build it. This was chosen over the previous attempt, a submodule, over concerns of accidentally destroying people's local modifications.
Diffstat (limited to 'scripts/azure-pipelines/Create-PRDiff.ps1')
-rw-r--r--scripts/azure-pipelines/Create-PRDiff.ps120
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/azure-pipelines/Create-PRDiff.ps1 b/scripts/azure-pipelines/Create-PRDiff.ps1
new file mode 100644
index 000000000..599118089
--- /dev/null
+++ b/scripts/azure-pipelines/Create-PRDiff.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