Created
June 3, 2011 18:22
-
-
Save un33k/1006866 to your computer and use it in GitHub Desktop.
Setup your virtualenv & virtualenvwrapper to create directory for each work item
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
#=== Add VirtualEnv ======= | |
# add local bin to path | |
PATH=$HOME/projects/bin:$PATH | |
export PATH | |
# virtualevnwrapper | |
export VHOME_DIR=$HOME/projects | |
export WORKON_HOME=$VHOME_DIR/.$HOSTNAME-virenv | |
export PIP_DOWNLOAD_CACHE=$VHOME_DIR/.pip_cache_dir | |
source /usr/local/bin/virtualenvwrapper.sh | |
mkdir -p $WORKON_HOME > /dev/null 2>& 1 | |
alias mkvenv='mkvirtualenv --no-site-packages' | |
#---- optional ------ | |
# virtualenv aliases | |
# http://blog.doughellmann.com/2010/01/virtualenvwrapper-tips-and-tricks.html | |
alias v='workon' | |
alias v.deactivate='deactivate' | |
alias v.mk='mkvirtualenv --no-site-packages' | |
alias v.mk_withsitepackages='mkvirtualenv' | |
alias v.rm='rmvirtualenv' | |
alias v.switch='workon' | |
alias v.add2virtualenv='add2virtualenv' | |
alias v.cdsitepackages='cdsitepackages' | |
alias v.cd='cdvirtualenv' | |
alias v.lssitepackages='lssitepackages' | |
#===================== | |
#Install virtualenv and in .virevn directory ==== | |
#add to: postactivate | |
#================== | |
#!/bin/bash | |
# This hook is run after every virtualenv is activated. | |
MY_PROJ=$(basename $VIRTUAL_ENV) | |
PROJ_PATH=~/projects/workon/$HOSTNAME/$MY_PROJ | |
mkdir -p $PROJ_PATH > /dev/null 2>&1 | |
echo "Working on: $PROJ_PATH" | |
cd $PROJ_PATH | |
#======= | |
#the above will create a directory per work-item in a directoy on your choice. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment