aboutsummaryrefslogtreecommitdiff
path: root/scripts/azure-pipelines/windows/Check-CMakeFunctionDocumentation.ps1
blob: 5505c3401770dfd123eb837645dcffcc428bc8c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
[CmdletBinding()]
Param(
    [Parameter(Mandatory=$True)]
    [string]$Root
)

if (-not (Test-Path "$Root/.vcpkg-root"))
{
    Write-Error "The vcpkg root was not at $Root"
    throw
}

& "$Root/docs/regenerate.ps1" -VcpkgRoot $Root -WarningAction 'Stop'

$changedFiles = & "$PSScriptRoot/Get-ChangedFiles.ps1" -Directory "$Root/docs"
if ($null -ne $changedFiles)
{
    $msg = @(
        "",
        "The documentation files do not seem to have been regenerated.",
        "Please re-run `docs/regenerate.ps1`."
    )
    $msg += ""

    $msg += "This should produce the following diff:"
    $msg += git diff "$Root/docs"

    Write-Error ($msg -join "`n")
    throw
}