Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relocatable activate as https://github.com/pypa/virtualenv/issues/11 #143

Closed
wants to merge 1 commit into from

Conversation

kra
Copy link

@kra kra commented Jun 23, 2011

This implements the suggestion from #11 for activate.sh.

VIRTUAL_ENV is made dynamic, so activate will work with a relocated virtualenv.

Other activation scripts have not been changed.

@misaka
Copy link

misaka commented Oct 31, 2011

This commit will break compatibility with zsh ($BASH_SOURCE is bash-specific) and with Mac OS X (readlink's -f option isn't supported on OS X ... and possibly on BSD in general).

I think the cd ... solution is probably a better one, although it's less efficient, but unfortunately I'm not sure what's the best way around the $BASH_SOURCE issue. In zsh $0 would work, so perhaps a zsh-specific script would be required.

@jpenney
Copy link

jpenney commented Mar 6, 2012

This works for both bash and zsh (tested on Linux/Mac OS/Cygwin) on paths with and without spaces in the name.

VIRTUAL_ENV="$(cd "$(dirname "${BASH_SOURCE:-0}")/.."; pwd)"

@carljm
Copy link

carljm commented Mar 14, 2012

Closing as superseded by #236.

@carljm carljm closed this Mar 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants