Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(@angular/cli): handle duplicate arguments #22966

Merged
merged 1 commit into from Apr 11, 2022
Merged

fix(@angular/cli): handle duplicate arguments #22966

merged 1 commit into from Apr 11, 2022

Conversation

alan-agius4
Copy link
Collaborator

@alan-agius4 alan-agius4 commented Apr 11, 2022

With this change we add a Yargs middleware that normalizes non Array options when the argument has been provided multiple times.

By default, when an option is non array and it is provided multiple times in the command line, yargs
will not override it's value but instead it will be changed to an array unless duplicate-arguments-array is disabled.
But this option also have an effect on real array options which isn't desired.

See: yargs/yargs-parser#163 (comment)

Closes #22956

@alan-agius4 alan-agius4 added the target: major This PR is targeted for the next major release label Apr 11, 2022
@alan-agius4 alan-agius4 requested a review from clydin April 11, 2022 08:34
@alan-agius4 alan-agius4 added the action: review The PR is still awaiting reviews from at least one requested reviewer label Apr 11, 2022
Copy link
Member

@clydin clydin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice idea with the middleware.

With this change we add a Yargs middleware that normalizes non Array options when the argument has been provided multiple times.

By default, when an option is non array and it is provided multiple times in the command line, yargs
will not override it's value but instead it will be changed to an array unless `duplicate-arguments-array` is disabled.
But this option also have an effect on real array options which isn't desired.

See: yargs/yargs-parser#163 (comment)

Closes #22956
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Apr 11, 2022
@dgp1130 dgp1130 merged commit ff4eba3 into angular:master Apr 11, 2022
@alan-agius4 alan-agius4 deleted the parser-middleware branch April 11, 2022 18:46
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Passing multiple --configuration options broken as of 14.0.0-next.5
3 participants