-
Notifications
You must be signed in to change notification settings - Fork 2
/
run_docs.sh
executable file
·47 lines (41 loc) · 977 Bytes
/
run_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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
SCRIPTPATH="$(dirname "$0")"
cd "$SCRIPTPATH" || exit 255
SHOULD_DOXYGEN=1
SHOULD_BUILD=0
function watch_doxygen() {
while inotifywait -r -e modify include; do
doxygen Doxyfile
done
}
while (("$#")); do
case "$1" in
-h | --help)
echo "Usage: $0 [options]"
echo "Options:"
echo " -h, --help Show this help message and exit."
echo " -sd, --skip-doxygen Do not generate Doxygen documentation."
echo " -b, --build Build artifacts rather than serving."
;;
-sd | --skip-doxygen)
SHOULD_DOXYGEN=0
;;
-b | --build)
SHOULD_BUILD=1
;;
*) break ;;
esac
shift
done
if [ $SHOULD_BUILD -eq 1 ]; then
doxygen Doxyfile
elif [ $SHOULD_DOXYGEN -eq 1 ]; then
doxygen Doxyfile
watch_doxygen &
fi
if [ $SHOULD_BUILD -eq 1 ]; then
cp -R doxygen docs/
mkdocs build
else
mkdocs serve -a 0.0.0.0:8000
fi