-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·67 lines (56 loc) · 1010 Bytes
/
build.sh
File metadata and controls
executable file
·67 lines (56 loc) · 1010 Bytes
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
66
67
#!/bin/bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
usage() {
cat <<EOF
Usage: ./build.sh [OPTION]
Options:
--v7.1 Build only v7.1 (runs v7.1/build.sh)
--v7.0 Build only v7.0 (runs v7.0/build.sh)
--merge Merge already-built outputs into _html
--all Build v7.0 and v7.1, then merge (default)
EOF
}
build_v7_0() {
(cd "$SCRIPT_DIR/v7.0" && ./build.sh)
}
build_v7_1() {
(cd "$SCRIPT_DIR/v7.1" && ./build.sh)
}
merge_outputs() {
rm -rf "$SCRIPT_DIR/_html_merged"
cp -R "$SCRIPT_DIR/v7.1/docs/_build/html" "$SCRIPT_DIR/_html_merged"
cp -R "$SCRIPT_DIR/v7.0/docs/_build/html" "$SCRIPT_DIR/_html_merged/v7.0"
}
mode="--all"
if [ "$#" -gt 1 ]; then
usage
exit 1
fi
if [ "$#" -eq 1 ]; then
mode="$1"
fi
case "$mode" in
--v7.0)
build_v7_0
;;
--v7.1)
build_v7_1
;;
--merge)
merge_outputs
;;
--all)
build_v7_0
build_v7_1
merge_outputs
;;
-h|--help)
usage
;;
*)
echo "Unknown option: $mode" >&2
usage
exit 1
;;
esac