Closed Tradunsky closed 2 years ago
Hi @Tradunsky, thanks for the feedback.
The issue here is that by default tasks are of type cmd, meaning they're executed as direct subprocesses (without involving a shell).
You can get what you want (i.e. the ability to use POSIX shell syntax) by defining a task of type shell. You can specify the task type by declaring the task as a subtable, with the task type as the key containing the task content. TOML supports several different way of achieving this, the simplest looks like:
[tool.poe.tasks]
create-dotenv.shell = "echo 'VARIABLE=VALUE' > .env"
You can also change the default task type, though the trade off of using shell tasks is that they might not always work the same on windows since it doesn't always have a POSIX shell installed.
You'll find more details and examples in the README. I'll close this issue now, but feel free to reply if there's more to it.
Thanks for creating such a convenient tool 🙏🏻
One thing that is a bit confusing to me is command output redirect does not work:
Current workaround:
However, it does not play with chained tasks :(