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

don't override falsy values in process.env #17

Merged
merged 1 commit into from
Mar 13, 2019

Conversation

legendar
Copy link
Contributor

@legendar legendar commented Aug 8, 2018

No description provided.

@ericrallen
Copy link
Contributor

Based on some quick testing with another project this seems to resolve #18

@ericrallen
Copy link
Contributor

@motdotla Any chance of this getting merged in?

Is there anything else you'd want to see in a PR like this to get it across the finish line or is there a different way you'd see the fix being implemented?

@@ -8,7 +8,7 @@ var dotenvExpand = function (config) {
var key = match.replace(/\$|{|}/g, '')

// process.env value 'wins' over .env file's value
var variable = process.env[key] || config.parsed[key] || ''
var variable = process.env.hasOwnProperty(key) ? process.env[key] : (config.parsed[key] || '')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the two lines you updated be abstracted into a method given the similarities between the two?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, this is not code refactoring PR. it just fixing an issue.
you can make you own fork and make some additional changes, but it looks like there no chance to merge it.

@motdotla
Copy link
Owner

This looks good. Thank you guys, good catch. Merging.

@motdotla motdotla merged commit c0bad34 into motdotla:master Mar 13, 2019
@motdotla
Copy link
Owner

This is available in 5.0.0 now https://www.npmjs.com/package/dotenv-expand

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

Successfully merging this pull request may close these issues.

3 participants