File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 1
- param ([switch ]$Serve )
1
+ param ([switch ]$Serve , [ switch ] $Clean )
2
2
3
3
$toolsPath = [System.IO.Path ]::GetFullPath(" $PSScriptRoot \..\tools" )
4
4
$docfxZipPath = [System.IO.Path ]::GetFullPath(" $toolsPath \docfx.zip" )
5
5
$docfxBinPath = [System.IO.Path ]::GetFullPath(" $toolsPath \docfx\" )
6
6
$docfxExePath = [System.IO.Path ]::GetFullPath(" $docfxBinPath \docfx.exe" )
7
7
$docfxJsonPath = [System.IO.Path ]::GetFullPath(" $PSScriptRoot \..\docs\docfx.json" )
8
+ $sitePath = [System.IO.Path ]::GetFullPath(" $PSScriptRoot \..\docs\_site" )
8
9
9
10
# Ensure the tools path exists
10
11
mkdir $toolsPath - Force | Out-Null
@@ -18,12 +19,17 @@ if (![System.IO.File]::Exists($docfxExePath)) {
18
19
Expand-Archive $docfxZipPath - DestinationPath $docfxBinPath - Force - ErrorAction " Stop"
19
20
}
20
21
22
+ # Clean the _site folder if necessary
23
+ if ($Clean.IsPresent ) {
24
+ Remove-Item - Path $sitePath - Force - Recurse - Confirm | Out-Null
25
+ }
26
+
21
27
# Build the metadata for the C# API
22
- & $docfxExepath metadata $docfxJsonPath
28
+ & $docfxExePath metadata $docfxJsonPath
23
29
24
30
if ($Serve.IsPresent ) {
25
- & $docfxExepath build $docfxJsonPath -- serve
31
+ & $docfxExePath build $docfxJsonPath -- serve
26
32
}
27
33
else {
28
- & $docfxExepath build $docfxBinPath
34
+ & $docfxExePath build $docfxJsonPath
29
35
}
You can’t perform that action at this time.
0 commit comments