-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathcompile.sh
More file actions
executable file
·36 lines (30 loc) · 840 Bytes
/
compile.sh
File metadata and controls
executable file
·36 lines (30 loc) · 840 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
#!/bin/bash
# Demonstrates how to compile the documentation for local testing
# Check dependencies are installed
if [[ $(uname) == 'Linux' ]]; then
if [[ ! $(which python3) ]]; then
echo "Could not find python3-venv on the PATH."
echo "Try: apt install python3-venv"
exit 1
fi
fi
if [[ ! $(which pip3) ]]; then
echo "Could not find pip3 on the PATH."
echo "Try: apt install python3-pip"
exit 1
fi
# Create a Python virtual environment if needed
if [[ ! -d venv ]]; then
python3 -m venv venv
fi
# Activate the virtual environment
source venv/bin/activate
# Install the Python requirements on the virtual environment
if [[ -f requirements.txt ]]; then
pip install -r requirements.txt
else
echo "The requirements.txt file is not present, exiting"
exit 1
fi
# Compile the documentation
make html linkcheck