fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] Making env changes persistent to the current session?


From: Lars van der bijl
Subject: Re: [Fab-user] Making env changes persistent to the current session?
Date: Thu, 1 Dec 2011 13:37:16 +0000

as fabric is running as a sub process from the shell you initiated it
from I don't think you can influence it's parent.
I did sped some time looking this up for pyhton and couldn't find a
way to do it.
but maybe there are some clever clogs here who know how.


On 1 December 2011 13:21, Jorge Vargas <address@hidden> wrote:
> Hi,
>
> I think I expressed myself wrong. What I want is to have the effect
> spawn outside of python. So I can provide a fab command that will
> enhance the activate script from virtualenv.
>
> For example:
>
> $ fab activate
> $ pip install some_package
>
> and some_package will end up inside the venv as it was activated by
> the fabric script.
>
> My goal here will be to replace an equivalent activate.sh that
> modifies the state of the current session (in the shell) not in
> python.
>
> On Sun, Nov 27, 2011 at 4:46 PM, Jeff Forcier <address@hidden> wrote:
>> Hi Jorge,
>>
>> On Thu, Nov 24, 2011 at 2:34 PM, Jorge Vargas <address@hidden> wrote:
>>> Hi,
>>>
>>> I was wondering if this is possible. I want something like this.
>>>
>>> def activate():
>>>    local('source env/bin/activate')
>>
>> You'll need to use prefix() for this, it's in the context managers API docs:
>>
>>    
>> http://docs.fabfile.org/en/1.3.3/api/core/context_managers.html#fabric.context_managers.prefix
>>
>> As for why, see this FAQ:
>>
>>    
>> http://docs.fabfile.org/en/1.3.3/faq.html#my-cd-workon-export-etc-calls-don-t-seem-to-work
>>
>> Best,
>> Jeff
>>
>> --
>> Jeff Forcier
>> Unix sysadmin; Python/Ruby engineer
>> http://bitprophet.org
>>
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/fab-user



reply via email to

[Prev in Thread] Current Thread [Next in Thread]