-
Notifications
You must be signed in to change notification settings - Fork 507
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 Dotenv.parse method #362
Conversation
fae5c0b
to
a3f8d16
Compare
I might find this useful. Would you mind adding docs to the README and I'll get it shipped? |
Exposes parsing logic as a public API to allow programmatic inspection of .env files without modifying ENV. One such use case is for automated application setup to create/read/modify .env files prior to running the application for the first time.
a3f8d16
to
0ec4862
Compare
@jonmagic Thanks, updated to document in README. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one suggestion. Let me know what you think and I'll get it shipped.
Co-Authored-By: rossta <[email protected]>
Hi folks, we have an use case like this:
this use case is broken right after the dotenv 2.7.0 release. The |
👋 I believe it might actually related to #374 where I implemented an actual options parser. Sorry for the inconvenience this has caused! I'll take a look at this now. |
👋 @c9s I believe you can get the same net effect with the following:
The options parser is reading your subsequent script as part of dotenv invocation instead of the command you wish to invoke. I can take a look at alternatives in a separate PR for a future patch, but this should resolve your issue immediately. |
Opening the PR for discussion around a new feature request.
Exposes parsing logic as a public API to allow programmatic inspection of .env files without modifying
ENV
.One such use case is for automated application setup to create/read/modify
.env
files prior to running the application for the first time. I found the need to dive intoDotenv
internals to accomplish such a task while debugging installation scripts on a recent project and thought it would be useful to avoid relying on internal details.