Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@palazzem
Created February 22, 2016 22:53
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 palazzem/ec46023507b345d4cf83 to your computer and use it in GitHub Desktop.
Save palazzem/ec46023507b345d4cf83 to your computer and use it in GitHub Desktop.
#!/bin/bash
VENV=$1
if [ -z $VENV ]; then
echo "usage: runinenv [virtualenv_path] CMDS"
exit 1
fi
. ${VENV}/bin/activate
if [ -f ${VENV}/bin/postactivate ]; then
. ${VENV}/bin/postactivate
fi
shift 1
exec "$@"
deactivate
if [ -f ${VENV}/bin/postdeactivate ]; then
. ${VENV}/bin/postdeactivate
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment