-
Notifications
You must be signed in to change notification settings - Fork 75
/
buildAllDocs
executable file
·59 lines (51 loc) · 1.34 KB
/
buildAllDocs
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
#!/bin/bash
echo "-----------Building documentation pages-----------\n"
RED='\033[0;31m'
NC='\033[0m' # No color
YELLOW='\033[33m'
GREEN='\033[32m'
currentDir=$(pwd)
target="docs_server"
while getopts ":hg" opt; do
case ${opt} in
h)
echo "Usage:"
echo "To build for local docs server run ./buildAllDocs"
echo "To build for main website run ./buildAllDocs -g"
exit 0
;;
g)
target="supertokens_backend"
;;
\?)
echo "Invalid Option: -$OPTARG" 1>&2
echo "Usage:"
echo "To build for local docs server run ./buildAllDocs"
echo "To build for main website run ./buildAllDocs -g"
exit 1
;;
esac
done
shift $((OPTIND - 1))
for d in *; do
if [ -d "$d" ]; then
dirName=$(basename $d)
if [ $dirName == "static" ] || [ $dirName == "docs_dev_server" ] || [ $dirName == "v2" ]; then
continue
fi
if [ "$target" = "docs_server" ]; then
./buildDocs $dirName
fi
if [ "$target" = "supertokens_backend" ]; then
./buildDocs -g $dirName
fi
fi
done
if [ "$target" = "docs_server" ]; then
./buildDocs
fi
if [ "$target" = "supertokens_backend" ]; then
./buildDocs -g
fi
# we must execute buildDocsForProduction inside the v2 folder only.
(cd ./v2 && npm run build)