Created
April 18, 2013 11:07
-
-
Save homburg/5411931 to your computer and use it in GitHub Desktop.
Generic virtual environment
This file contains hidden or 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
#!/usr/bin/env bash | |
echo "*** Remeber to call this with source ***" | |
echo "Activating \"virtual environment\" (modifying PATH). | |
Use \"deactivate\" to escape" | |
function deactivate () { | |
PS1=$_OLD_PS1 | |
PATH=$_OLD_PATH | |
WRK=$_OLD_WRK | |
unset -f deactivate | |
} | |
_OLD_PS1=$PS1 | |
_OLD_PATH=$PATH | |
_OLD_WRK=$WRK | |
LOCAL_BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
LOCAL_VENDOR_BIN_DIR=$( readlink -f "${LOCAL_BIN_DIR}/../vendor/vendor/bin/" ) | |
PS1="grammatip venv:${PS1}" | |
PATH="${LOCAL_BIN_DIR}:${LOCAL_VENDOR_BIN_DIR}:${PATH}" | |
WRK="$( readlink -f "${LOCAL_BIN_DIR}/../" )" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment