From dab794e6fb1543a61586c060ccdb84a88119df5f Mon Sep 17 00:00:00 2001 From: ZhiQiang Fan Date: Mon, 9 Sep 2013 14:22:44 +0800 Subject: [PATCH] Enclose command args in with_venv.sh Sync tools/with_venv.sh from oslo, it will support argument with blanks. Change-Id: Ibb802b21d609ea6b54fc168b17705f06ad1cb86a Closes-Bug: #1220937 --- tools/with_venv.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/with_venv.sh b/tools/with_venv.sh index c8d2940fc7..7303990bd8 100755 --- a/tools/with_venv.sh +++ b/tools/with_venv.sh @@ -1,4 +1,7 @@ #!/bin/bash -TOOLS=`dirname $0` -VENV=$TOOLS/../.venv -source $VENV/bin/activate && $@ +TOOLS_PATH=${TOOLS_PATH:-$(dirname $0)} +VENV_PATH=${VENV_PATH:-${TOOLS_PATH}} +VENV_DIR=${VENV_NAME:-/../.venv} +TOOLS=${TOOLS_PATH} +VENV=${VENV:-${VENV_PATH}/${VENV_DIR}} +source ${VENV}/bin/activate && "$@"