Created
August 6, 2014 10:24
-
-
Save masci/c4c3f47ba2cdbad79bb0 to your computer and use it in GitHub Desktop.
runinenv.sh
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 | |
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 | |
#echo "Executing $@ in ${VENV}" | |
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