Enclose command args in with_venv.sh

Sync tools/with_venv.sh from oslo, it will support argument with
blanks.

Closes-Bug: #1220937
Change-Id: Id10528efcdd1abad3009c13f2c5bde6dcf172520
This commit is contained in:
ZhiQiang Fan 2013-09-08 16:14:40 +08:00
parent 5a5023bea0
commit 27d0463e93
1 changed files with 6 additions and 3 deletions

View File

@ -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 && "$@"