pyinvoke / invoke

Pythonic task management & command execution.
http://pyinvoke.org
BSD 2-Clause "Simplified" License
4.32k stars 365 forks source link

I can get to start a virtual engine with invoke 1.6.0 #834

Open ericel opened 2 years ago

ericel commented 2 years ago

I try this code:

 # Start virtual machine
    with ctx.cd("/Applications/dev/dir_apps/web"):
        with ctx.prefix("source bin/activate"):
            with ctx.cd("myapp"):
                ctx.run("python manage.py runserver")

All I get is this:

/bin/bash: bin/activate: No such file or directory

So what am I getting wrong?

ericel commented 2 years ago

I just noticed this happens because of the with ctx.prefix("source bin/activate"), needs an relative path to the virtual engine. So if I do something like this: ctx.prefix("source /Applications/dev/dir_apps/web/bin/activate") Then it works!!