sahara-dashboard/tools/with_venv.sh
chao liu 8005a7d916 use . instead of source.
Code conventions: Use “.” to source script files
When you have to source a script file, for example ,
a credentials file to gain access to user-only or
 admin-only CLI commands, use . instead of source.
See more:
http://docs.openstack.org/contributor-guide/writing-style/code-conventions

Change-Id: Ic4fd2da622f21e51f813e711cdedb7d1998592fd
2018-01-29 06:32:40 -08:00

11 lines
367 B
Bash
Executable File

#!/bin/bash
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}}
# tools/tox_install.sh looks for VIRTUAL_ENV evrythign else looks for VENV
# so for now make them the same.
VIRTUAL_ENV=${VENV:-${VENV_PATH}/${VENV_DIR}}
. ${VENV}/bin/activate && "$@"