-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·49 lines (42 loc) · 864 Bytes
/
run.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
#!/bin/bash
function print {
GREEN="\033[0;32m"
RESET="\033[0m"
echo -e "${GREEN}$1${RESET}"
}
BUILD=0
INSTALL_VENV=0
ARGS=''
while [ $# -gt 0 ] ; do
case $1 in
-b)
BUILD=1
;;
--install-venv)
INSTALL_VENV=1
;;
*)
ARGS="$ARGS $1"
;;
esac
shift
done
if [ ! -d "venv" ]; then
INSTALL_VENV=1
print "Virtual environment not found."
fi
if [ $INSTALL_VENV -eq 1 ]; then
if [ -d "venv" ]; then
print "Removing existing virtual environment..."
rm -rf venv
fi
print "Installing virtual environment..."
python3 -m venv venv
print "Installing dependencies"
./venv/bin/pip install -r requirements.txt
fi
COMMAND="serve"
if [ $BUILD -eq 1 ]; then
COMMAND="build"
fi
./venv/bin/mkdocs $COMMAND $ARGS