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

support 'single$quote' syntax to not expand #112

Closed
motdotla opened this issue Feb 10, 2024 · 5 comments
Closed

support 'single$quote' syntax to not expand #112

motdotla opened this issue Feb 10, 2024 · 5 comments

Comments

@motdotla
Copy link
Owner

motdotla commented Feb 10, 2024

add feature so that single quote syntax does not expand $ dollar signs. (this likely requires coordination with dotenv

who needs this? please let me know below.

@jahdiel
Copy link

jahdiel commented Feb 10, 2024

This latest release broke my staging environemnt. My .env file has something similar to:

HOST="something"
DOMAIN="https://${HOST}"

During deployment the dotenv-expand upgraded to the latest release and broke during runtime. The expansion failed, DOMAIN ended up with https://${HOST} as its value. Not sure if this was a non-backwards compatible release.

@motdotla
Copy link
Owner Author

@jahdiel what version did you bump up from?

And does your HOST value have a $ dollar sign in it?

@motdotla
Copy link
Owner Author

motdotla commented Feb 11, 2024

@jahdiel nevermind. i see the issue. working on the fix. so sorry about this. in the meantime, you can fix it by changing your dotenv expand code from:

var dotenv = require('dotenv')
var dotenvExpand = require('dotenv-expand')
dotenvExpand.expand(dotenv.config())

to

var dotenv = require('dotenv')
var dotenvExpand = require('dotenv-expand')
dotenvExpand.expand(dotenv.config({ processEnv: {} }))

@motdotla
Copy link
Owner Author

@jahdiel - please install v11.0.3. should be fixed. #113

sorry about this one. was a bad one. tests were formatted badly allowing it to sneak in. fixed going forward.

@motdotla
Copy link
Owner Author

dotenv-expand cannot reliably recognize single quotes. use dotenvx to reliably avoid expansion with single quotes.

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

No branches or pull requests

2 participants