Skip to content

Commit e42b14b

Browse files
committed
FIXUP
1 parent 218c3ea commit e42b14b

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

scripts/BuildDocs.ps1

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
param([switch]$Serve)
1+
param([switch]$Serve, [switch]$Clean)
22

33
$toolsPath = [System.IO.Path]::GetFullPath("$PSScriptRoot\..\tools")
44
$docfxZipPath = [System.IO.Path]::GetFullPath("$toolsPath\docfx.zip")
55
$docfxBinPath = [System.IO.Path]::GetFullPath("$toolsPath\docfx\")
66
$docfxExePath = [System.IO.Path]::GetFullPath("$docfxBinPath\docfx.exe")
77
$docfxJsonPath = [System.IO.Path]::GetFullPath("$PSScriptRoot\..\docs\docfx.json")
8+
$sitePath = [System.IO.Path]::GetFullPath("$PSScriptRoot\..\docs\_site")
89

910
# Ensure the tools path exists
1011
mkdir $toolsPath -Force | Out-Null
@@ -18,12 +19,17 @@ if (![System.IO.File]::Exists($docfxExePath)) {
1819
Expand-Archive $docfxZipPath -DestinationPath $docfxBinPath -Force -ErrorAction "Stop"
1920
}
2021

22+
# Clean the _site folder if necessary
23+
if ($Clean.IsPresent) {
24+
Remove-Item -Path $sitePath -Force -Recurse -Confirm | Out-Null
25+
}
26+
2127
# Build the metadata for the C# API
22-
& $docfxExepath metadata $docfxJsonPath
28+
& $docfxExePath metadata $docfxJsonPath
2329

2430
if ($Serve.IsPresent) {
25-
& $docfxExepath build $docfxJsonPath --serve
31+
& $docfxExePath build $docfxJsonPath --serve
2632
}
2733
else {
28-
& $docfxExepath build $docfxBinPath
34+
& $docfxExePath build $docfxJsonPath
2935
}

0 commit comments

Comments
 (0)