mysticatea / npm-run-all

A CLI tool to run multiple npm-scripts in parallel or sequential.
MIT License
5.72k stars 240 forks source link

Is it possible tun run system binaries? #184

Open akoidan opened 4 years ago

akoidan commented 4 years ago
{
   "lol": "run-s 'echo 1'"
}

ERROR: Task not found: "echo"

mysticatea commented 4 years ago

Thank you for your question.

No. This is a tool to run multiple npm-scripts in series or parallel.

mysticatea commented 4 years ago

Therefore, run-s 'echo 1' means "run 'echo' task with an argument 1."

akoidan commented 4 years ago

@mysticatea do we have something against supporting it? I can do the PR

airtonix commented 4 years ago

npm-run-all isn't the place for this, but a separate tool to do it would be great.

A cross-platform way to run commands in parrallel.

AnandChowdhary commented 4 years ago

A cross-platform way to run commands in parrallel.

concurrently is the standard in cross-platform parallel scripts running, and supports both npm and spawning, but, as the name suggests, doesn't support sequential execution, only parallel.

skubakdj commented 4 years ago

For anyone new to the package, the workaround seems to be to embed the command in a script:

{
    "lol": "run-s 'cmd:echo 1'",
    "cmd:echo": "echo"
}

Which produces the output:

↪ yarn lol
yarn run v1.22.4
$ run-s 'cmd:echo 1'
$ echo 1
1
Done in 0.43s.
airtonix commented 3 years ago

@skubakdj I wouldn't call it a workaround. it's a feature.

and it comes down to making sure your code is testable.

ls -al ./ && cp -r /usr/local/logs/MYAPP.* ./ && rm -rf ./MYAPP-things* && aws a3 sync ./MYAPP-others* blah && echo "👍 done"

How would you test just the cp -r /usr/local/logs/MYAPP.* without also polluting your test with the results of the rest of the above?

Having spent countless hours implementing CICD and local DX infrastructure I can tell you that this is certainly a feature.

My personal revulsion about having to implement extra npm/yarn tasks is that yarn or npm don't seem to want to support a yaml variant of the package.json file.

but at that point I'd really suggest you use something like :