aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rwxr-xr-xvenvworkon.sh5
2 files changed, 6 insertions, 1 deletions
diff --git a/README.md b/README.md
index acbec3b..21c5c92 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@ will be printed instead.
## Where venvs are created
When `workon` is called, venvs are created or loaded from the
-`$HOME/.venvs` folder by default.
+`$HOME/.venv` folder by default.
To change this behavior, set the `WORKON_HOME` environment
variable before sourcing `venvworkon.sh`.
diff --git a/venvworkon.sh b/venvworkon.sh
index 9dcd85c..d714936 100755
--- a/venvworkon.sh
+++ b/venvworkon.sh
@@ -18,6 +18,11 @@ workon() {
envdir="$WORKON_HOME/$1"
+ if [ "$1" == "." ]; then
+ target=$(basename `pwd`)
+ envdir="$WORKON_HOME/$target"
+ fi
+
# Creates virtual env if doesn't exists
if [ ! -e "$envdir" ]; then
python3 -m venv $envdir