Run-Commands: Arguments are incorrectly appended when using multiple commands
See original GitHub issueCurrent Behavior
When attempting to run multiple commands with arguments as shown in the docs, there are two scenarios:
- Commands that use argument(s):
- These run fine and are parsed correctly assuming you use
{args.some_arg}
- These run fine and are parsed correctly assuming you use
- Commands that do not use argument(s):
- These commands always get the raw arguments appended to it
- Ex: Passing the argument
--name=testing
, the commandmkdir scripts
would actually runmkdir scripts --name=testing
- This can cause commands to fail
- Note: This became a problem for us after upgrading Nx from 9.3.0 to 9.5.1.
Expected Behavior
Commands that do not use arguments should not have raw arguments appended to them as it can cause them to fail.
Steps to Reproduce
https://github.com/nrwl/nx-examples/pull/109
Failure Logs
Reference repro PR.
Environment
@nrwl/angular : Not Found @nrwl/cli : 9.5.1 @nrwl/cypress : 9.5.1 @nrwl/eslint-plugin-nx : 9.5.1 @nrwl/express : Not Found @nrwl/jest : 9.5.1 @nrwl/linter : 9.5.1 @nrwl/nest : 9.5.1 @nrwl/next : 9.5.1 @nrwl/node : 9.5.1 @nrwl/react : 9.5.1 @nrwl/schematics : Not Found @nrwl/tao : 9.5.1 @nrwl/web : 9.5.1 @nrwl/workspace : 9.5.1 typescript : 3.8.3
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How do I run two commands in one line in Windows CMD?
This problem can be resolved by using the Delayed Expansion feature (only available in batch files though). So try the following inside a...
Read more >How To Run Multiple Commands In Parallel on Linux
In case you need to execute several processes in batches, or in chunks, you can use the shell builtin command called "wait". See...
Read more >Automatically run commands over SSH on many servers
I'll be using public key authentication on all the servers. Here are some potential pitfalls: The ssh prompts me to put the given...
Read more >Invoke-Command (Microsoft.PowerShell.Core)
Using a single Invoke-Command command, you can run commands on multiple computers. To run a single command on a remote computer, use the...
Read more >Systems Manager Command document plugin reference
These parameters provide another view when listing metrics. You can use the same dimension for multiple metrics so that you can view all...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
There are two separate scenarios run-commands is used for:
I see the following options:
I think when using command (singular), forwarding by default is what you want.
There is not reason not to forward. You are wrapping another tool here. For multiple commands, not forwarding is probably more reasonable–cause args won’t align.
Maybe we can introduce forwardAllArgs option, default it to false when using “commands” (plural).
What do you think?
I would love to see this backported to 9.x. As far as I can tell it’s not supported in 9.7.0: