forked from corda/corda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-docsite-requirements.sh
executable file
·36 lines (32 loc) · 1.17 KB
/
install-docsite-requirements.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
#!/usr/bin/env bash
# The purpose of this file is to install the requirements for the docsite
# You can call it manually if running make manually, otherwise gradle will run it for you
set -xeo pipefail
# Install the virtualenv
if [ ! -d "virtualenv" ]
then
# If the canonical working directory contains whitespace, virtualenv installs broken scripts.
# But if we pass in an absolute path that uses symlinks to avoid whitespace, that fixes the problem.
# If you run this script manually (not via gradle) from such a path alias, it's available in PWD:
absolutevirtualenv="$PWD/virtualenv"
# Check if python2.7 is installed explicitly otherwise fall back to the default python
if type "python2.7" > /dev/null; then
virtualenv -p python2.7 "$absolutevirtualenv"
else
virtualenv "$absolutevirtualenv"
fi
fi
# Activate the virtualenv
if [ -d "virtualenv/bin" ]
then
# it's a Unix system
source virtualenv/bin/activate
else
source virtualenv/Scripts/activate
fi
# Install PIP requirements
if [ ! -d "virtualenv/lib/python2.7/site-packages/sphinx" ]
then
echo "Installing pip dependencies ... "
pip install -r requirements.txt
fi