3 # Script checks that venv exists. If it doesn't it will be created
4 # It requires python2.7 and virtualenv packages installed
8 function venv_install() {
9 if command -v virtualenv-2.7; then
11 elif command -v virtualenv2; then
13 elif command -v virtualenv; then
16 echo Cannot find virtualenv command.
21 # exit when something goes wrong during venv install
23 if [ ! -d "$BASEDIR/venv" ]; then
24 venv_install $BASEDIR/venv
25 echo "Virtualenv created."
28 if [ ! -f "$BASEDIR/venv/updated" -o $BASEDIR/requirements.pip -nt $BASEDIR/venv/updated ]; then
29 source $BASEDIR/venv/bin/activate
30 pip install -r $BASEDIR/requirements.pip
31 touch $BASEDIR/venv/updated
32 echo "Requirements installed."