maid
maid copied to clipboard
Introduce support for running multiple tasks in series
Because why not? It's easy addition.
Example (seen even in the maid's npm scripts)
maid lint test build
# equivalent of
maid lint && maid test && maid build
I guess this is unnecessary and it will be impossible to pass arguments to the task. https://github.com/egoist/maid#read-command-line-arguments
Yes. But this also may be a problem i'm describing here https://github.com/egoist/maid/pull/37#issuecomment-394989509
What if CLI that you run from task have also such task?
Let's consider an example that CLi that you want to run have command and optional sub-command such signature like yarn help add
. Currently if want to run only yarn help
from a task named add
in your maidfile (e.g. maid add
), it will actually run yarn help add
:D Of course, this example is very specific, but just to get the point.
## add
Some description
```sh
yarn help
```
I just thought... We can allow running multiple commands behind maid run task1 [task2] [task3]
command or through --run
flag e.g. maid --run task1 task2 task3
- which btw can't be workarounded here even with =
after the --run
, until we are kind of forced to use maid --run=task1,task2,task3
(because how cac
works).
But yea, you are kind of right, because we can use such maidfile to accomplish "run in series".
## full
```sh
maid lint && maid test && maid build
```
## lint
```sh
eslint src
```
## test
```sh
ava tests/
```
## build
```sh
babel src -d dist
```
so then just maid full
Building a task runner is a bit tricky some times. I know what it is, because I'm facing such problems, decisions and ideas while building v3 of hela
.
Should pay some trade-offs. But i'm based on sade
so don't have much problems, even can have sub-commands/sub-tasks without any problems - can have such descriptive definition of tasks
I've workedaround those conflicting by filtering out hela
's flags, so they are not passed to the executed command.
So to recap. We can close, your decision :)
You might get even fancier with maidfile.md
## full
Run tasks `one` `two` `three` after this
## one
```js
console.log(1)
```
## two
```js
console.log(2)
```
## three
```js
console.log(3)
```
Though something like
## full
Run tasks <tasks>
(no this, no before \ after) that resuls in
starting full
starting one
finished one
starting two
finished two
starting three
finished three
finished full
Might be really handy sytax sugar that would still allow for arguments and easy to type command
@VsevolodTrofimov mmm yeah. More and more considering that this PR can be closed. The point of markdown-driven task runner is to use markdown insead of cli for most of things (such like running multiple commands/tasks)
@tunnckoCore I have access to start merging, would you fix the conflicts and I will merge today. Thanks.
What conflicts? There are no conflicts.
The thing is that i'm still not sure if we want this.