pyinvoke / invoke

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

task 'list'/iterable to spaces. #914

Open cekvenich2 opened 1 year ago

cekvenich2 commented 1 year ago

If I write a task for apt, for example $invoke apt-i one two

@task(iterable=['pkgs'])
def apt_i(c, pkgs):
    cmd = "sudo apt-get -y -qq install " +pkgs
    result = c.run(cmd)

how do I make it do spaces ?

kuwv commented 1 year ago

@cekvenich2 f"sudo apt-get -y -qq install {' '.join(pkgs)}"