Answer the question
In order to leave comments, you need to log in
Fabric: how to run sudo() in cd() context?
from invoke import task
@task
def do(c):
with c.cd('/opt'):
c.run('pwd') # OK: "/opt"
c.sudo('pwd') # ERROR: "sudo: cd: command not found"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question