Created
October 9, 2013 14:14
-
-
Save pirhoo/6901994 to your computer and use it in GitHub Desktop.
Relative path for relocatable Virtualenv
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/sh | |
#... | |
VIRTUAL_ENV=`readlink -f ${BASH_SOURCE[0]:-$0}`; | |
# dirname gives us the containing dir (env/bin) path | |
VIRTUAL_ENV=`dirname "${VIRTUAL_ENV}"`; | |
# we do it once again to get the upper dir | |
VIRTUAL_ENV=`dirname "${VIRTUAL_ENV}"`; | |
export VIRTUAL_ENV; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment