Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fabric's cd context manager does not work

Tags:

python

fabric

I have set up my development environment on a new PC and seems I am having strange error with Fabric. Its 'cd' context manager seems does not change the current directory, and thus a lot of my commands don't work. I have written the test and it showed me results I have not expected to get:

from __future__ import with_statement from fabric.api import local, run, cd  def xxx():     with cd("src"):         local("pwd") 

Here are the results after running fab xxx:

[localhost] local: pwd /home/pioneer/workspace/myproject 

But instead of /home/pioneer/workspace/myproject there should be /home/pioneer/workspace/myproject/src, I think.

like image 733
Serge Tarkovski Avatar asked Apr 08 '11 12:04

Serge Tarkovski


1 Answers

You're looking for lcd (l for local) rather than cd (which is remote).

like image 162
Daniel Roseman Avatar answered Sep 25 '22 02:09

Daniel Roseman