diff options
author | Baptiste Darthenay <baptiste@darthenay.fr> | 2016-12-27 19:54:25 +0100 |
---|---|---|
committer | Baptiste Darthenay <baptiste@darthenay.fr> | 2016-12-27 20:19:33 +0100 |
commit | b5775083a1fe12b3393789ad6b4ea67c67112558 (patch) | |
tree | 31d9722c22ca594d29b7421436cd2426ab8f252f /venvworkon.sh | |
parent | e33cb3f849dc32e5c0f083ac5f1394dc792b32a1 (diff) |
Using WORKON_HOME instead of envroot.
This improves compatibility with virtualenvwrapper.
Diffstat (limited to 'venvworkon.sh')
-rwxr-xr-x | venvworkon.sh | 13 |
1 files changed, 8 insertions, 5 deletions
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 |