Last active
August 29, 2015 14:17
-
-
Save marciomazza/10190d251ac50dd018af to your computer and use it in GitHub Desktop.
Virtualenv general postactivate hook to trigger sublime projects and more
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 every virtualenv is activated. | |
# (~/.virtualenvs/postactivate) | |
DOT_PROJECT="${VIRTUAL_ENV}/.project" | |
if [ -f $DOT_PROJECT ]; then | |
PROJECT_DIR=`head -n 1 ${DOT_PROJECT} | tr -d '[[:space:]]'` | |
# GIT status | |
if [ -d "$PROJECT_DIR/.git" ]; then | |
git -C $PROJECT_DIR status -sb | |
fi | |
fi | |
unset DOT_PROJECT PROJECT_DIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment