-
Notifications
You must be signed in to change notification settings - Fork 47
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 configuration to disable variable substitution #113
Comments
Do you have a specific way in mind to disable substitution? |
Perhaps adding a new i.e. DotEnvBuilder::new().with_variable_substution(false).load()? or DotEnvBuilder::new().from_filename("my_filename").load()? The existing methods would still work: |
We are currently redesigning the API to allow for more extensible configuration. A builder pattern is likely to be part of it. In the meantime, variable substitution is the same as in the vast majority of other "dotenv" implementations. You can escape it with a backslash or strong single quotes—the same as most shells' handling of environment variables. KEY_ONE='$VAL'
ANOTHER_KEY=\$VAL Both |
@phillipleblanc good idea. This will be supported in the next release. |
Hi @aidenfarley, I am working on a design locally. I haven't opened a PR yet, but it will come before the Rust 2024 edition. Stay tuned. |
Hello, there is a new API on the v0.16 branch. PRs are welcome to that branch. I would suggest |
The variable substitution feature of
dotenv
means that any environment variables that should have the$
in them are removed.I would like a way to disable this functionality, since my project doesn't need it and it causes surprise among users when they discover their environment variables aren't working as expected.
The text was updated successfully, but these errors were encountered: