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

Feature: Move dotenv toward bash-like behavior #521

Closed
motdotla opened this issue May 5, 2021 · 5 comments
Closed

Feature: Move dotenv toward bash-like behavior #521

motdotla opened this issue May 5, 2021 · 5 comments
Labels

Comments

@motdotla
Copy link
Owner

motdotla commented May 5, 2021

Dotenv currently varies its behavior vs bash's behavior when sourcing .env files.

Consider moving toward behavior that will match bash.

Other discussions:

should require a major version bump

@motdotla motdotla added the TODO label May 5, 2021
@motdotla motdotla changed the title Breaking Change: Move dotenv toward bash-like behavior Feature: Move dotenv toward bash-like behavior May 5, 2021
@xzyfer
Copy link

xzyfer commented Sep 1, 2021

Would "bash's behavior when sourcing .env files" also include supporting exported values (#112, #177, #213, and more)?

@devon-whil
Copy link

Is there any work around currently that allows the use of a dollar sign character?

@martin-braun
Copy link

martin-braun commented Aug 26, 2022

@devon-whil KEY='asd$asd' works for me, but only if you choose to not expand the variables. If you expand the variables, you can use KEY="asd\$asd" just fine.

@phoenixeliot
Copy link

For anyone else having trouble with this: For an env variable that had to be JSON with interpolated string values, I had to do this non-bash-standard syntax:

SOME_VAR='["$INTERPOLATED_VAR","$OTHER_VAR"]'

This was in Next.js v12, which I think uses this package now. I know at some point they used their own custom thing, so not 100% sure about that.

@motdotla motdotla closed this as completed May 4, 2023
@motdotla motdotla reopened this May 4, 2023
@motdotla
Copy link
Owner Author

motdotla commented Jan 18, 2024

this effort will move into https://github.com/dotenvx/dotenvx (where a single consistent standard for .env file parsing is being developed across all languages and platforms)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants