From f8e87cb6cc735e9742c798ae66dd2dc984536845 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Thu, 20 Feb 2014 08:24:42 -0500 Subject: [PATCH] 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 --- tools/with_venv.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/with_venv.sh b/tools/with_venv.sh index 94e05c12..262b86d4 100755 --- a/tools/with_venv.sh +++ b/tools/with_venv.sh @@ -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 && "$@"