Last active
December 29, 2015 05:09
-
-
Save mike1e/7619662 to your computer and use it in GitHub Desktop.
switch folders with virtualenv
This file contains 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
# In the postmkvirtualenv script I have the following to create a directory based on the project name, | |
# add that directory to the python path and then cd into it: | |
proj_name=$(echo $VIRTUAL_ENV|awk -F'/' '{print $NF}') | |
mkdir $HOME/projects/$proj_name | |
add2virtualenv $HOME/projects/$proj_name | |
cd $HOME/projects/$proj_name | |
# In the postactivate script I have it set to automatically change to the project | |
# directory when I use the workon command: | |
proj_name=$(echo $VIRTUAL_ENV|awk -F'/' '{print $NF}') | |
cd ~/projects/$proj_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment