Fix default path in tools/with_venv.sh

Current default path for virtual environment in tools/with_venv.sh
is .venv, but official documentation uses tox, and actual path
for those following it will be .tox/pyXY. This patch tries to find
appropriate tox environment.

Change-Id: I78d8cbdf7cc31ccc27f3ef5c3c8cc0630b1b2eff
This commit is contained in:
Dmitry Tantsur 2014-02-20 08:24:42 -05:00
parent 13faf8b889
commit f8e87cb6cc
1 changed files with 2 additions and 1 deletions

View File

@ -1,7 +1,8 @@
#!/bin/bash
tools_path=${tools_path:-$(dirname $0)}
venv_path=${venv_path:-${tools_path}}
venv_dir=${venv_name:-/../.venv}
tox_env=$(cd ${venv_path} && find ../.tox -maxdepth 1 -name "py*" | sort | tail -n1)
venv_dir=${venv_name:-${tox_env}}
TOOLS=${tools_path}
VENV=${venv:-${venv_path}/${venv_dir}}
source ${VENV}/bin/activate && "$@"