>
> This context manager is identical to cd
> <http://docs.fabfile.org/en/1.10/api/core/context_managers.html#fabric.context_managers.cd>,
> except that it changes a different env var (lcwd, instead of cwd) and
> thus only affects the invocation of local
> <http://docs.fabfile.org/en/1.10/api/core/operations.html#fabric.operations.local>
>  and
> the local arguments to get
> <http://docs.fabfile.org/en/1.10/api/core/operations.html#fabric.operations.get>
> /put
> <http://docs.fabfile.org/en/1.10/api/core/operations.html#fabric.operations.put>
> .


From
http://docs.fabfile.org/en/1.10/api/core/context_managers.html#fabric.context_managers.lcd

If you use local('pwd'), it will reflect the change.

>>> local('pwd')
> [localhost] local: pwd
> /home/issa
> ''
> >>> with lcd("/usr/bin"):
> ...   local('pwd')
> ...
> [localhost] local: pwd
> /usr/bin
> ''
> >>>




On Tue, Sep 29, 2015 at 2:14 PM, Paul Hoffman <[email protected]>
wrote:

> ...but maybe it is just me.
>
> print(os.getcwd())
> with lcd("/usr/bin"):
>   print(os.getcwd())
>
> ...prints the same location name twice, and it is clear that the cd didn't
> happen.
>
> print(os.getcwd())
> with lcd("/does/not/exist"):
>   print(os.getcwd())
>
> ...prints the same location name twice. lcd doesn't throw an error, which
> I would have thought it would.
>
> Is this what is expected?
>
> --Paul Hoffman
>
> _______________________________________________
> Fab-user mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/fab-user
>
>
_______________________________________________
Fab-user mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/fab-user

Reply via email to