diff options
-rw-r--r-- | README.md | 2 | ||||
-rwxr-xr-x | venvworkon.sh | 5 |
2 files changed, 6 insertions, 1 deletions
@@ -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 |