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
Add settings to control environment file name #945
Comments
This should be like @xorander00 explained in #941, right?
And if one isn't found, silently (?) skip it? |
Yeah, that's right. If a user wants it to be an error if an environment file isn't found, we could add another setting, like |
Just saw this, sweet! :) Will build from latest commit & give it a shot this weekend and report back if I run into any issues. @casey I think that would be a good setting, yes. Although personally, I'd consider making it a numeric (or enum-like) state flag instead of a boolean toggle. Not sure how it would work in just, but something like |
I think that would be reasonable. And it can always be a keyword, like |
@casey Can we change .env file in recipe? Like this: # Start application in dev mode with .dev-env supported
start-dev:
set dotenv-filenames := [".env", ".dev-env"]
# Start application in test mode with .test-env loaded
start-test:
set dotenv-filenames := [".env", ".test-env"] |
I think it's probably impossible to change a |
Thanks for your reply. As the example I gave above: it's quite common that when a APP starts in dev mode with envs different from in test mode, such as DB config, backend service URL, etc. How to achieve this ? |
I'm not entirely sure. There's a complication here, which is that
Since an expression can't be of type array, only string. You could use |
Got it, Thanks |
I'd like to suggest one more thing with regards to loading of the |
At the moment, it seems that it's not possible to load a specific path for the What if it could all happen using the same Regarding being able to use arrays for multiple... This seems to work: |
Is it correct that currently the way to load an |
Here is a use case why setting a custom path would be helpful: NextJS projects have a convention of putting the |
Implemented in #1692. |
Hey @casey, I was wondering if there are plans to support multiple dotenv files? It seems like the PR implemented only support a single dotenv file compared to what was proposed here. It would be great to be able to have Just load dotenv files like in https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use. Thanks! 🙌 |
@evandam I'm not opposed! I think it was just left out to make the initial implementation simpler. Can you create a new issue and describe your use case? In particular, I'm curious if you want to load multiple dotenv files at the same time, or if to go through a list of dotenv files, and load the first one that's found. |
Something like:
The text was updated successfully, but these errors were encountered: