Skip to content

Running a task that has "&&" in it doesn't work. #85

Answered by nat-n
adhamsalama asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @adhamsalama,

Absolutely there's a way to make this work. Firstly the issue you're facing it that the default type of task (called a "cmd" task) is a single subprocess without a shell. If you want to invoke the task using a shell (and thereby get support for POSIX shell syntax like &&) then you need a shell task which by default will use bash.

For example the following should do what you want:

[tool.poe.tasks]
test.shell = "mypy . && pytest ."

Note that shell tasks depend on the relevant shell executable on the host system. This means they're slightly less portable than other task types, because windows users might not have bash installed.

However it's also possible to achieve this usi…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@adhamsalama
Comment options

@nat-n
Comment options

Answer selected by adhamsalama
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #84 on August 11, 2022 19:22.