Asdf: how to source scripts from asdf?

Created on 7 Aug 2017  路  2Comments  路  Source: asdf-vm/asdf

I'm using Python's Virtualenvwrapper package, installed with python 3.5.2 via asdf, and I'm having an issue with properly sourcing the .virtualenvwrapper.sh file.

Essentially, ~/.asdf/shims/virtualenvwrapper.sh is just a proxy that runs an exec line, as so:

exec /Users/nate/.asdf/bin/private/asdf-exec python bin/virtualenvwrapper.sh "$@"

however, because I don't want to _execute_ the shell script, but rather source it, attempting to run the command simply causes my terminal to exit prematurely.

My current workaround is to do

. $(asdf where python $(asdf current python))/bin/virtualenvwrapper_lazy.sh

It works, but it's a bit hacky. Is there a better way to do this?

enhancement help wanted

All 2 comments

Yes unfortunately there isn't a better way to do this. Now we have asdf which so you could do

. $(asdf which python)/bin/virtualenvwrapper_lazy.sh

but that's still kind of hacky. Shims always exec, and there is no way to get the shell to source scripts from inside the exec.

Can we get this documented properly on the README somewhere? I feel like this is a fairly common thing for me, and while it's not rocket science it'd be nice to have an official position on it.

Was this page helpful?
0 / 5 - 0 ratings