Skip to content

Instantly share code, notes, and snippets.

@marciomazza
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marciomazza/10190d251ac50dd018af to your computer and use it in GitHub Desktop.
Save marciomazza/10190d251ac50dd018af to your computer and use it in GitHub Desktop.
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