dsherret / dax

Cross-platform shell tools for Deno and Node.js inspired by zx.
MIT License
965 stars 33 forks source link

Support providing a `CommandBuilder` to a template literal expr #239

Open dsherret opened 5 months ago

dsherret commented 5 months ago

This needs to be thought out a lot more, but essentially I would like all of these to execute in parallel:

const cmd1 = $`echo 1`;
const cmd2 = $`echo 2`;
const cmd3 = $`echo 3`;

await $`echo ${cmd1} ${cmd2} ${cmd3}`;

And none of these to execute because it errors before the relevant pipeline occurs:

const cmd1 = $`echo 1`;
const cmd2 = $`echo 2`;
const cmd3 = $`echo 3`;

await $`exit 1 && echo ${cmd1} ${cmd2} ${cmd3}`;

It should work when provided to a string like so:

const cmd1 = $`echo 1`;
await $`echo 'example ${cmd1} example'`;

This needs a ton of thought especially around error handling. Probably there will need to be something done in deno_task_shell to make it work well.

zph commented 3 months ago

Thank you for the excellent error message that leads here and more broadly for dax 💯