Last active
June 1, 2017 23:44
-
-
Save alairock/e6b9539a6c7f1a50effcfa435c1cfe3f to your computer and use it in GitHub Desktop.
Activate virtual environment (Assumes ./venv/bin/activate as activator)
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
cd(){ | |
venvactifile=./venv/bin/activate | |
builtin cd "$@"; | |
if [ -e "$venvactifile" ]; then | |
source $venvactifile | |
export PYTHONPATH=$(pwd) | |
echo "IN LIKE FLYNN" | |
else | |
if type deactivate >/dev/null 2>&1 | |
then | |
deactivate | |
echo "Leaving Environment" | |
fi | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment