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

Update Commander version #208

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Update Commander version #208

wants to merge 3 commits into from

Conversation

Tordek
Copy link

@Tordek Tordek commented Sep 20, 2024

dotenv supports passing multiple .env files as an array, but the old version of commander does not support variadic parameters.

Updated `commander` version
Changed to new `Command` module
Use `opts` instead of `program`
Slight reorganization in `create` due to ordering.
Add test for multiple envs
@LeonardoGastonRossi
Copy link

Thanks. I have been waiting for this feature my whole life

@wesleytodd
Copy link
Collaborator

Thanks for the work @Tordek. Unfortunately it looks like there are many changes in here which are unrelated to .env file loading. That makes it quite hard to review and merge. Would you be up for moving all the other stuff out of this PR?

@Tordek
Copy link
Author

Tordek commented Jan 16, 2025

It's not really possible. Commander needs to be updated to support the ... syntax, and the API for commander changed:

  • new Command() usage.
  • program.option was replaced by program.opts().option
  • due to ^ some changes where the program accessed program.options at the root of the file need to be moved inside the action, so opts are parsed.

I could remove the redis dev dependency if that's an issue but it's used in the tests, so it's needed.

@wesleytodd
Copy link
Collaborator

Ah, thanks for the clarification. Yes I can see how this is related now. In that case, I would recommend doing two prs:

  1. update commander
  2. add support for multiple .env

That should be easy enough to just remove the variadic from the .env option right?

@Tordek
Copy link
Author

Tordek commented Jan 16, 2025

Fair enough, I'll do that.

@Tordek Tordek changed the title Feature/multi env Update Commander version Jan 16, 2025
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.

3 participants