mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
24 lines
710 B
Bash
24 lines
710 B
Bash
DEFAULT_VIRTUALENV_WRAPPERS=(
|
|
"/usr/local/bin/virtualenvwrapper.sh" # Default install location
|
|
"/etc/bash_completion.d/virtualenvwrapper" # Ubuntu install location
|
|
)
|
|
for VIRTUALENV_WRAPPER in $DEFAULT_VIRTUALENV_WRAPPERS
|
|
do
|
|
if [[ -s "${VIRTUALENV_WRAPPER}" ]]; then
|
|
break
|
|
fi
|
|
done
|
|
|
|
if [[ ! -n "${VIRTUALENV_WRAPPER}" ]] && [[ -s "${DEFAULT_VIRTUALENV_WRAPPER}" ]]; then
|
|
VIRTUALENV_WRAPPER=${DEFAULT_VIRTUALENV_WRAPPER}
|
|
fi
|
|
|
|
if [[ -s "${VIRTUALENV_WRAPPER}" ]]; then
|
|
if [[ ! -n "${WORKON_HOME}" ]]; then
|
|
export WORKON_HOME=$HOME/.virtualenvs;
|
|
fi
|
|
if [[ ! -d ${WORKON_HOME} ]]; then
|
|
mkdir -p "${WORKON_HOME}"
|
|
fi
|
|
source "${VIRTUALENV_WRAPPER}";
|
|
fi
|