Make virtualenv installable if the checkout path has whitespace. (#1187)

This commit is contained in:
Andrzej Cichocki 2017-08-18 13:31:00 +01:00 committed by GitHub
parent 2829faa01f
commit adc33273f6

View File

@ -7,11 +7,15 @@ 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 virtualenv
virtualenv -p python2.7 "$absolutevirtualenv"
else
virtualenv virtualenv
virtualenv "$absolutevirtualenv"
fi
fi
@ -29,4 +33,4 @@ if [ ! -d "virtualenv/lib/python2.7/site-packages/sphinx" ]
then
echo "Installing pip dependencies ... "
pip install -r requirements.txt
fi
fi