Created
November 7, 2012 20:14
-
-
Save acdha/4034103 to your computer and use it in GitHub Desktop.
virtualenvwrapper hooks: see http://virtualenvwrapper.readthedocs.org/en/latest/scripts.html
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
#!/bin/bash | |
# This hook is run after a new virtualenv is activated. | |
set -e | |
(cat <<'PYDOC' | |
#!/usr/bin/env python | |
import pydoc | |
if __name__ == '__main__': | |
pydoc.cli() | |
PYDOC | |
) > $VIRTUAL_ENV/bin/pydoc | |
chmod +x $VIRTUAL_ENV/bin/pydoc | |
(cat <<'POSTACTIVATE' | |
#!/bin/sh | |
export PROJECT_ROOT=$HOME/Projects/__PROJECT_ROOT__ | |
export PATH=$PROJECT_ROOT/bin:$PATH | |
pushd $PROJECT_ROOT | |
POSTACTIVATE | |
) > $VIRTUAL_ENV/bin/postactivate | |
sed -i -e "s/__PROJECT_ROOT__/`basename $VIRTUAL_ENV`/g" $VIRTUAL_ENV/bin/postactivate | |
chmod +x $VIRTUAL_ENV/bin/postactivate | |
pip install -q pep8 flake8 pyflakes ipython ipdb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment