-
-
Save nvie/5064055 to your computer and use it in GitHub Desktop.
Use in place of `workon`. Put it in ~/bin.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ENV="$1" | |
shift 1 | |
VIRTUAL_ENV="${WORKON_HOME}/${ENV}" | |
if [ ! -f "${VIRTUAL_ENV}/bin/python" ]; then | |
echo "No virtualenv named '$ENV'." | |
exit 2 | |
fi | |
# Activate | |
export VIRTUAL_ENV="$VIRTUAL_ENV" | |
export PATH="$VIRTUAL_ENV/bin:$PATH" | |
unset PYTHON_HOME | |
exec "${@:-$SHELL}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment