Skip to content

Instantly share code, notes, and snippets.

@marciomazza
Last active Aug 29, 2015
Embed
What would you like to do?
Virtualenv general postactivate hook to trigger sublime projects and more
#!/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