forked from exercism/fsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-docs.ps1
39 lines (33 loc) · 973 Bytes
/
update-docs.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
38
39
<#
.SYNOPSIS
Regenerate the docs.
.DESCRIPTION
Regenerate the docs for all exercises based on the latest canonical data.
.PARAMETER Exercise
The slug of the exercise to regenerate the doc for (optional).
.EXAMPLE
The example below will regenerate all docs
PS C:\> ./update-docs.ps1
.EXAMPLE
The example below will regenerate the doc for the "acronym" exercise
PS C:\> ./update-docs.ps1 acronym
#>
param (
[Parameter(Position = 0, Mandatory = $false)]
[string]$Exercise
)
# Import shared functionality
. ./shared.ps1
function Update-Canonical-Data {
Write-Output "Updating canonical data"
Run-Command "./update-canonical-data.ps1"
}
function Update-Docs {
Write-Output "Updating docs"
$args = if ($Exercise) { @("-o", $Exercise) } else { @() }
Run-Command "./bin/fetch-configlet"
Run-Command "./bin/configlet generate . -p problem-specifications $args"
}
Update-Canonical-Data
Update-Docs
exit $LastExitCode