aboutsummaryrefslogtreecommitdiff
path: root/venvworkon.sh
diff options
context:
space:
mode:
Diffstat (limited to 'venvworkon.sh')
-rwxr-xr-xvenvworkon.sh13
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