forked from PowerDNS/lightningstream
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-docs.sh
executable file
·33 lines (28 loc) · 951 Bytes
/
update-docs.sh
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
#!/bin/sh
function autogen_warning() {
echo
echo "<!-- ======================================================= -->"
echo "<!-- AUTOMATICALLY GENERATED BY update-docs.sh - DO NOT EDIT -->"
echo "<!-- ======================================================= -->"
echo
}
(
autogen_warning
# Replace a string with contents of a file
# https://stackoverflow.com/a/25557287/297793
awk 'NR==FNR { a[n++]=$0; next }
/__CONFIG__/ { for (i=0;i<n;++i) print a[i]; next }
1' example.yaml docs/configuration.template.md
autogen_warning
) > docs/configuration.md
# Run this one last, since go run can be slow
(
autogen_warning
echo "# Commands"
echo
echo 'This page describes the various subcommands supported by the `lightningstream` command.'
echo
autogen_warning
go run ./cmd/lightningstream --config docker/pdns/lightningstream.yaml docs
autogen_warning
) > docs/commands.md