Skip to content

fix: ensure --lang option requires a value#10877

Open
AyushKashyapII wants to merge 2 commits intoember-cli:masterfrom
AyushKashyapII:fix-lang-error-handling
Open

fix: ensure --lang option requires a value#10877
AyushKashyapII wants to merge 2 commits intoember-cli:masterfrom
AyushKashyapII:fix-lang-error-handling

Conversation

@AyushKashyapII
Copy link
Copy Markdown

Description

The new command previously allowed the --lang flag to be passed without a value (e.g., ember new my-app --lang), resulting in the project being created with an empty language string.

This PR adds a check to ensure that if --lang is present, it must have a value. If not, it rejects with a SilentError.

Reproduction

  1. Run ember new my-app --lang
  2. Observe that the app is created successfully (unexpected behavior).

Solution

Added a validation check in lib/commands/new.js and a corresponding unit test in tests/unit/commands/new-test.js.

@AyushKashyapII
Copy link
Copy Markdown
Author

Hi @kategengler ,

I hope you are having a good week!

I just wanted to gently follow up on this PR regarding the fix for the --lang flag validation. I have verified that all CI checks are passing and the tests cover the reported issue.

I know this is a busy time of year, but whenever you have a moment, I would appreciate a review. Please let me know if there are any other changes required!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant