forked from daattali/beautiful-jekyll
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyspinw_docs.sh
More file actions
60 lines (42 loc) · 1.29 KB
/
pyspinw_docs.sh
File metadata and controls
60 lines (42 loc) · 1.29 KB
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
if [[ $# -eq 1 && "$1" == "rebuild" ]]; then
echo "Rebuild flag is set"
REBUILD=true
else
REBUILD=false
fi
# Warn about dangers
echo "Warning: If it is possible that this script could delete things you don't want it to. Make sure things are backed up."
echo "Note: use '$0 rebuild' to clean directories first... more unsafe"
echo
read -p "Are you sure? (Y/[N])" -n 1 -r
echo
# Check confirmation
if [[ $REPLY =~ ^[Yy]$ ]]
then
mkdir -p docsbuild
cd docsbuild
if [[ "$REBUILD" == "true" ]]; then
# Clean directory
rm -rf *
# Get git repo
git clone https://github.com/SpinW/pySpinW/
fi
cd pySpinW
if [[ "$REBUILD" == "true" ]]; then
export PYTHONPATH="./pyspinw/:$PYTHONPATH"
# Set up venv
echo "Setting up VENV"
python3 -m venv .venv
source .venv/bin/activate
# Get required packages
echo "Getting pdoc"
python -m pip install pdoc
echo "Getting dependencies"
python -m pip install -r requirements.txt
fi
# Get ready to build
echo "Building"
python -m pdoc pyspinw --no-show-source --favicon /img/spinw3_logo_square.png --logo /img/pyspinw_logo.png -o ../docs
cp ../docs/pyspinw.html ../../pythonapi.html
echo "Done!"
fi