forked from moveit/moveit2_tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_locally.sh
executable file
·55 lines (46 loc) · 1.13 KB
/
build_locally.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
#!/bin/bash -eu
have_loop() {
for arg in "$@"; do
if [[ "${arg}" == "loop" ]]; then
return 0
fi
done
return 1
}
have_noinstall() {
for arg in "$@"; do
if [[ "${arg}" == "noinstall" ]]; then
return 0
fi
done
return 1
}
if [[ "$0" != "${BASH_SOURCE}" ]]; then
{
echo "This file is meant to be executed, not 'source'd:"
echo
echo " ./${BASH_SOURCE}"
} >&2
return 1
fi
################################################################################
# Begin Main Script
################################################################################
# Install dependencies, unless argument says to skip
if ! have_noinstall "$@"; then
pip3 install --user --upgrade -r requirements.txt
fi
# A fresh build is required because changes to some components such as css files does not rebuilt currently
# See issue https://github.com/sphinx-doc/sphinx/issues/2090
# rm -rf build
# Build
make local-with-api
# Run
xdg-open ./build/html/index.html &
# Optional build loop
if have_loop "$@"; then
while inotifywait -re modify,move,create,delete .; do
rm -rf build
make html
done
fi