npm-run-all icon indicating copy to clipboard operation
npm-run-all copied to clipboard

feature request: --waterfall

Open clonq opened this issue 9 years ago • 9 comments

how about adding a --waterfall command line option?

clonq avatar Feb 07 '16 15:02 clonq

Could you explain what is it?

mysticatea avatar Feb 07 '16 20:02 mysticatea

Runs the tasks in series, each passing their results to the next as in https://github.com/caolan/async#waterfall

clonq avatar Feb 09 '16 01:02 clonq

Thank you.

Hmm, what is the result of CLI tool? It sounds like pipe: npm run a | npm run b | npm run c But I'm not sure it's possible.

mysticatea avatar Feb 09 '16 01:02 mysticatea

Yes it is a pipe. The same way we try to avoid doing task1 && task2 && task 3 it might be beneficial to pipe the result of one task into another. The output of the last task would be the output of the CLI. E.g. get-json-async | jq 'json selector' | write-to-file

clonq avatar Feb 12 '16 00:02 clonq

OK, I will challenge to add --waterfall option.

mysticatea avatar Feb 12 '16 02:02 mysticatea

I'm sorry, I'm busy now. I will do this by early next month, but if someone can make a PR, please don't wait for me.

mysticatea avatar Feb 25 '16 00:02 mysticatea

I do not work on osx or win very much but both supports pipe (powershell and git bash...). Would these be equivalent? npm-run-all -w \"get-json-async\" \"jq 'json selector'\" \"write-to-file\" and npm-run-all get-json-async | jq 'json selector' | write-to-file

I do not see the purpose npm-run-all has (lack of imagination?) unless we can do globs parallel: npm-run-all -p -w \"get-json-async\" \"jq 'json selector'\" \"write-to-file\"

in which case wouldn't interpreting the pipe be more intuitive than the flag? npm-run-all -p get-json-async:* | jq 'json selector' | write-to-file

tomdavidson avatar Sep 10 '16 05:09 tomdavidson

This has not implemented yet :sweat_smile: I have not gotten enough time for this issue for long time...

mysticatea avatar Sep 10 '16 05:09 mysticatea

npm-run-all -w \"get-json-async\" \"jq 'json selector'\" \"write-to-file\" and npm-run-all get-json-async | jq 'json selector' | write-to-file

Yes, it's the plan. npm-run-all executes npm-scripts from right to left in --waterfall, then connects those by pipe.

mysticatea avatar Sep 10 '16 05:09 mysticatea