[rush] Add defaultCommand command-line parameter #4236
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Add
defaultCommand
command-line parameter to Buld and Phase command kinds.Fixes #1168
Fixes #1797
Details
So far even with
shellCommand
, we still don't have a official way to override or ser a default command.Before I found a workaround like bellow:
But it's quite tricky, accourding to that I suggest to have a
defaultCommand
parameter for this situation,Comapare to
shellCommand
, it has a lower priority than package.json script, so user can use script field as an override, and setdefaultCommands
to prevent verbose set empty script string in each project which need to be skiped.I have considered about using a flag like
priority
to reuse the theshellCommand
, but I think it will become a mess, but it's open for discussion.With this update, we can finally set default command like bellow:
How it was tested
test cases:
Impacted documentation
command-line.json