summaryrefslogtreecommitdiffstats
path: root/bashrc/common/virtualenv.sh
blob: c3e0ea91bd2764ef8f694eb3c6e9cfcf7bda73cb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
export WORKON_HOME="$HOME/.virtualenvs/"
if [ ! -d "${WORKON_HOME}" ]; then
	mkdir -p "${WORKON_HOME}"
fi

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