From b5775083a1fe12b3393789ad6b4ea67c67112558 Mon Sep 17 00:00:00 2001 From: Baptiste Darthenay Date: Tue, 27 Dec 2016 19:54:25 +0100 Subject: Using WORKON_HOME instead of envroot. This improves compatibility with virtualenvwrapper. --- venvworkon.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'venvworkon.sh') diff --git a/venvworkon.sh b/venvworkon.sh index 1da01bd..adca644 100755 --- a/venvworkon.sh +++ b/venvworkon.sh @@ -1,20 +1,23 @@ workon() { - envroot="$HOME/.venv" + if [ -z "$WORKON_HOME" ] + then + WORKON_HOME="$HOME/.venv" + fi - if [ ! -e "$envroot" ] + if [ ! -e "$WORKON_HOME" ] then - mkdir -p "$envroot" + mkdir -p "$WORKON_HOME" fi if [ "$#" -lt "1" ] then - ls "$envroot" + ls "$WORKON_HOME" return fi envname=$1 - envdir="$envroot/$envname" + envdir="$WORKON_HOME/$envname" if [ ! -e "$envdir" ] then -- cgit v1.2.3