binstubs and vagrant exec foo interact with environment variables differently
Closed this issue · 3 comments
danielknell commented
a python virtualenv can be activated by including its bin directory in the path, so the following works well for vagrant exec foo
style calls
config.exec.commands "*", env: { "PATH" => "/home/vagrant/env/bin:$PATH" }
in this case $PATH is evaluated on the server, but when generating binstubs, it would create:
ssh -F .vagrant/ssh_config -q -t default "bash -l -c 'export PATH=/home/vagrant/env/bin:$PATH && make $@'"
this evaluates $PATH on the client side instead.
escaping the string as follows causes both to evaluate the path on the server side.
ssh -F .vagrant/ssh_config -q -t default "bash -l -c 'export PATH=/home/vagrant/env/bin:\$PATH && make $@'"
p0deje commented
Thanks for the bug report! Are you willing to submit a pull request fixing this?
danielknell commented
I am not sure where to start but I will take a look when i find some free time.
p0deje commented
Thanks, let me know if you need any assistance.