trove/tools/with_venv.sh
Nikhil Manchanda 5e7757faa6 Update tools/install_venv.py to work w/ latest pip
pip dropped the -E option as of 1.1; now to install in a virtualenv,
you just explicitly activate the virtualenv.  This commit fakes the
same behavior of explicitly specifying a virtualenv for installation
by altering tools/with_venv.sh to optionally take the -E flag

Fixes Bug #1081200

Change-Id: I470ba9563864337b8af2a79ae463e269ba66bf8f
2012-11-21 15:34:14 -05:00

31 lines
476 B
Bash
Executable File

#!/bin/bash
set -e
me=${0##*/}
dir="$(dirname $0)"
function print_usage() {
cat >&2 <<EOS
Run commands in a default (or specific) virtualenv
Usage: $me [-E venv] commands
Options:
-h prints out this message
-E venv use this virtualenv (default: ${venv})
EOS
}
venv="${dir}/../.venv"
while getopts ":hE:" opt; do
case "$opt" in
h|\?) print_usage; exit 1 ;;
E) venv=$OPTARG ;;
esac
done
shift $((OPTIND-1))
source "${venv}/bin/activate" && $@