-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sh
executable file
·58 lines (42 loc) · 1.09 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
#!/bin/bash -eu
source /build-common.sh
COMPILE_IN_DIRECTORY="cmd/passitron"
BINARY_NAME="passitron"
GOFMT_TARGETS="cmd/ pkg/"
# clean slate, because generated files rarely pass formatting check
cleanupGeneratedFiles() {
rm -rf \
docs_ready/ \
pkg/**/*.gen.go
}
buildInternalDependenciesDocs() {
echo "\`\`\`" > docs/internal-dependencies.md
(cd cmd/passitron && depth . | grep github.com/function61/passitron/ | grep -v vendor) >> docs/internal-dependencies.md
echo "\`\`\`" >> docs/internal-dependencies.md
}
generateCommandlineUserguideDocs() {
# because help text self reflects its binary name
cp rel/passitron_linux-amd64 passitron
cat << EOF > docs/user-guides/command-line.md
To receive help, just run:
\`\`\`
./passitron --help
$(./passitron --help)
\`\`\`
Any subcommand will also give you help:
\`\`\`
./passitron server --help
$(./passitron server --help)
\`\`\`
EOF
# cleanup
rm -f passitron
}
if [ ! -n "${FASTBUILD:-}" ]; then
cleanupGeneratedFiles
fi
standardBuildProcess
if [ ! -n "${FASTBUILD:-}" ]; then
buildInternalDependenciesDocs
generateCommandlineUserguideDocs
fi