-
Notifications
You must be signed in to change notification settings - Fork 32
/
build.sh
executable file
·65 lines (58 loc) · 1.66 KB
/
build.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
function readAndResolveIncludes() {
while IFS= read -r line
do
if [[ "$line" =~ ^\[include.*\]$ ]]
then
include_file=(`echo "${line#[include}"`)
include_file=(`echo "${1%/*}/${include_file%]}"`)
readAndResolveIncludes "$include_file"
else
echo "$line"
fi
done < $1
}
rm -rf docs/*
#files=($(find src -type f -name '*.md'))
files=(
src/aws/setup-testnet-validator-from-scratch.md
src/ubuntu/setup-testnet-validator-from-scratch.md
src/faq-user.md
src/faq-validator.md
src/testnet.md
src/testnet-rewards.md
src/testnet/testnet-upgrades.md
src/testnet/upgrade-1_1_0.md
src/testnet/upgrade-1_1_2.md
src/testnet/upgrade-1_2_0.md
src/testnet/upgrade-1_2_1.md
src/testnet/upgrade-1_3_1.md
src/testnet/upgrade-1_3_2.md
src/testnet/upgrade-1_3_4.md
src/testnet/upgrade-1_4_1.md
src/testnet/upgrade-1_4_2.md
src/testnet/upgrade-1_4_3.md
src/testnet/upgrade-1_4_4.md
src/testnet/upgrade-1_4_5.md
src/testnet/upgrade-1_4_6.md
src/testnet/upgrade-1_4_7.md
src/testnet/upgrade-1_4_8.md
src/testnet/upgrade-1_4_10.md
src/testnet/upgrade-1_4_13.md
src/testnet/upgrade-1_4_15.md
src/testnet/upgrade-1_5_2.md
src/testnet/upgrade-1_5_3.md
src/testnet/upgrade-1_5_5.md
src/testnet/upgrade-1_5_6.md
src/testnet/upgrade-1_5_7.md
src/testnet/upgrade-1_5_8.md
)
for file in ${files[*]}
do
outfile="docs/${file#src/}"
outdir=${outfile%/*}
mkdir -p "${outdir}"
touch "${outfile}"
printf " %s > %s\n" $file $outfile
readAndResolveIncludes "$file" > $outfile
done