-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTestPackage.ps1
37 lines (32 loc) · 1.13 KB
/
TestPackage.ps1
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
31
32
33
34
35
36
37
function Assert ([scriptblock] $condition)
{
if (!(& $condition))
{
throw "Condition {$condition} does not hold."
}
}
$rootdir = split-path -parent $MyInvocation.MyCommand.Definition
Set-Location $rootdir
[Environment]::CurrentDirectory = $rootdir
Write-Host "Installing the package."
dotnet tool install -g LiterateCS --add-source LiterateCS\bin\Release
Write-Host "Generating HTML documentation for LiterateCS."
& {
$ErrorActionPreference = "SilentlyContinue"
& literatecs LiterateCS\*.cs LiterateCS.Theme\*.cs *.md -s LiterateCS.sln -o docs -f html -tv
}
Assert { $LASTEXITCODE -eq 0 }
Assert { Test-Path docs }
Assert { Test-Path docs\*.html }
Assert { Test-Path docs\LiterateCS\*.html }
Assert { Test-Path docs\LiterateCS.Theme\*.html }
Assert { Test-Path docs\bootstrap }
Assert { Test-Path docs\css\*.min.css }
Assert { Test-Path docs\font-awesome }
Assert { Test-Path docs\Images\*.png }
Assert { Test-Path docs\mermaid\*.css }
Assert { Test-Path docs\sidebar\*.min.css }
Assert { Test-Path docs\syntax-highlight\*.min.css }
Write-Host "Uninstalling the package."
dotnet tool uninstall -g LiterateCS
Pop-Location