-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·51 lines (44 loc) · 1.08 KB
/
bootstrap.sh
File metadata and controls
executable file
·51 lines (44 loc) · 1.08 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
#!/usr/bin/env bash
VENV="venv"
PLUGINS="${VENV}/pelican-plugins"
THEME="${VENV}/dev-random4"
# Check prerequisites
prerequisites=(git virtualenv python3)
echo "Checking prerequisites..."
for prerequisite in ${prerequisites[@]}; do
echo -n " ${prerequisite}... "
if ! type "$prerequisite" &> /dev/null; then
echo "missing command ${prerequisite} in path."
echo "Cancelling bootstrap..."
return 1
else
echo "OK"
fi
done
if [ ! -d "${VENV}" ]; then
virtualenv -p python3 ${VENV}
fi
source ${VENV}/bin/activate
pip install -r requirements.txt
# Install plugins
if [ -d "${PLUGINS}" ]; then
cd ${PLUGINS}
git reset --hard
git pull --rebase
cd -
else
git clone --recursive https://github.com/getpelican/pelican-plugins ${PLUGINS}
fi
# Install theme
if [ -d "${THEME}" ]; then
cd ${THEME}
git reset --hard
git pull --rebase
git submodule update
cd -
else
git clone git@github.com:adericbourg/pelican-dev-random4.git ${THEME}
fi
echo "Installing theme"
pelican-themes --clean
pelican-themes --upgrade ${THEME}