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

Lucky aware loading #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hovsater
Copy link
Contributor

@hovsater hovsater commented Jul 7, 2021

This is an attempt at implementing Lucky aware loading. I decided to use overloading instead of introducing LuckyEnv.load!. I extended the macro to now take a env_file argument that associates a given path with the environment.

Not sure if this is the approach we want to pursue, but it's a starting point. 🙂

@hovsater
Copy link
Contributor Author

hovsater commented Jul 10, 2021

@jwoertink is this inline with what you had in mind? 🙂

@jwoertink
Copy link
Member

I'll have to come back to this. I looked over it briefly, and I think it looks ok, but I forget what I was originally intending... 😂 Thanks for giving this a shot!

@hovsater
Copy link
Contributor Author

Sounds good! If we deem it unnecessary, I'm happy just closing it. No hard feelings, haha. 😅

Copy link

@wout wout left a comment

Choose a reason for hiding this comment

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

@hovsater This is great. I'd love to see this merged but I think one improvement would make it perfect. Here's what I would like to suggest.

It .env could be considered the "global" file, which is loaded in all environments, and a .env.development would be added, then we could also avoid duplication of env vars.

A bit like it's outlined here: https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use. Although, that approach is going too far in my opinion.

@jwoertink
Copy link
Member

Sorry for the late review. This just came up again in the Lucky Discord. I love @wout's idea, but I'm also ok with maybe merging this as is, and we can update it with that idea after?

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