Created
September 1, 2012 21:32
-
-
Save gilsondev/3588030 to your computer and use it in GitHub Desktop.
Cria variável de ambiente que aponta para o caminho da pasta do projeto ao ativar o ambiente com virtualenvwrapper.
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
# Plus: Creating alias for manage.py of django projects (with manage.py in root) | |
alias manage='$PROJECT_PATH/manage.py' |
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/bash | |
# This hook is run after every virtualenv is activated. | |
# Basically create a environment variable which return absolute path in the project. | |
# | |
# PROJECT_HOME = /home/user/Devel | |
# PROJECT_PATH = /home/user/Devel/your_project | |
if [ -e $VIRTUALENVWRAPPER_PROJECT_FILENAME ]; then | |
FILE_PATH=$(find $VIRTUAL_ENV -name $VIRTUALENVWRAPPER_PROJECT_FILENAME) | |
export PROJECT_PATH=$(cat $FILE_PATH) | |
fi |
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/bash | |
# This hook is run after a new project is activated. | |
# Basically create a environment variable which return absolute path in the project. | |
# | |
# PROJECT_HOME = /home/user/Devel | |
# PROJECT_PATH = /home/user/Devel/your_project | |
if [ -e $VIRTUAL_ENV ]; then | |
FILE_PATH=$(find $VIRTUAL_ENV -name $VIRTUALENVWRAPPER_PROJECT_FILENAME) | |
export PROJECT_PATH=$(cat $FILE_PATH) | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment