summaryrefslogtreecommitdiffstats
path: root/bashrc
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2012-06-27 13:39:43 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2012-06-27 13:39:43 +0200
commiteb82e89283cfba739148cbcebe9ba26d29a54cd3 (patch)
tree8e01075483de025a89a77b0efced4b72c49cedd1 /bashrc
parent950adb8580729d8d97ba8f7a9fd7f03590cded2f (diff)
downloaddotfiles-eb82e89283cfba739148cbcebe9ba26d29a54cd3.tar.gz
dotfiles-eb82e89283cfba739148cbcebe9ba26d29a54cd3.tar.xz
dotfiles-eb82e89283cfba739148cbcebe9ba26d29a54cd3.zip
bash/common: always set WORKON_HOME
Diffstat (limited to 'bashrc')
-rw-r--r--bashrc/common/virtualenv.sh15
1 files changed, 11 insertions, 4 deletions
diff --git a/bashrc/common/virtualenv.sh b/bashrc/common/virtualenv.sh
index 7ba48b9..c3e0ea9 100644
--- a/bashrc/common/virtualenv.sh
+++ b/bashrc/common/virtualenv.sh
@@ -1,6 +1,13 @@
-if hash "virtualenvwrapper.sh" 2>/dev/null; then
- source $(which virtualenvwrapper.sh)
+export WORKON_HOME="$HOME/.virtualenvs/"
+if [ ! -d "${WORKON_HOME}" ]; then
+ mkdir -p "${WORKON_HOME}"
fi
-# build absolut path (needed for prompt)
-export WORKON_HOME="$(cd "${WORKON_HOME}" 2>&1 >/dev/null; pwd -P)"
+if [ -d "${WORKON_HOME}" ]; then
+ if hash "virtualenvwrapper.sh" 2>/dev/null; then
+ source $(which virtualenvwrapper.sh)
+ fi
+
+ # build absolut path (needed for prompt)
+ export WORKON_HOME="$(cd "${WORKON_HOME}" 2>&1 >/dev/null; pwd -P)"
+fi