aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Pasquet <dev@bitimplosion.com>2017-08-18 09:58:28 +0100
committerGuillaume Pasquet <dev@bitimplosion.com>2017-08-18 09:58:28 +0100
commit21ee17afb76219d6e04050e0470aabcc8d4f8131 (patch)
treed194b739aa5352816d3bf37579fdb9e168c136b5
parent69346e8bc81cbb73d39b1e4135cc51183702ab04 (diff)
Added shorthand to create/load env with current folder name
-rwxr-xr-xvenvworkon.sh5
1 files changed, 5 insertions, 0 deletions
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