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

Allow empty vars in safe mode #133

Closed
mkrause opened this issue Jun 27, 2018 · 9 comments
Closed

Allow empty vars in safe mode #133

mkrause opened this issue Jun 27, 2018 · 9 comments

Comments

@mkrause
Copy link
Contributor

mkrause commented Jun 27, 2018

In #14, empty variables were allowed, but only in non-safe mode. But even in safe mode we'd often like to use an empty string as a possible value. Can we make a distinction between .env variables that are not specified as opposed to variables that are just empty?

# .env.example
FOO=default
BAR=default
# .env
FOO=

The lack of BAR should result in an error, FOO should not.

Also worth noting that dotenv-safe allows empty values, configurable through an "allowEmptyValues" option.

@mrsteele
Copy link
Owner

Hmmmm, Yeah if dotenv-safe supports that we should probably too, but I think it should be configurable just like dotenv. Any chance you wanna make a go at it?

mkrause added a commit to mkrause/dotenv-webpack that referenced this issue Jun 27, 2018
mkrause added a commit to mkrause/dotenv-webpack that referenced this issue Jun 27, 2018
@mkrause
Copy link
Contributor Author

mkrause commented Jun 27, 2018

Sure! I just submitted PR #134. I've added an option allowEmptyValues (default false), similar to dotenv-safe.

@mkrause
Copy link
Contributor Author

mkrause commented Jul 4, 2018

@mrsteele Do you think you'll have time to review?

@nusson
Copy link

nusson commented Feb 28, 2020

Any update on this ?

@marcofugaro
Copy link

Is this repo dead? This feature is actually useful

@mrsteele
Copy link
Owner

mrsteele commented May 7, 2020

Anyone willing to resolve the conflicts?

@marcofugaro
Copy link

If @mkrause is not available, I am willing to make a new PR with the old one's content.

@mkrause
Copy link
Contributor Author

mkrause commented May 7, 2020

I can fix the conflicts. Over the weekend maybe.

@mkrause
Copy link
Contributor Author

mkrause commented May 10, 2020

Updated the PR

mrsteele pushed a commit that referenced this issue May 11, 2020
* (#133) Add option allowEmptyValues.
* (#133) Add README example for allowEmptyValues.
* (allowEmptyValues) Update PR to be compatible with latest master.
Co-authored-by: Matt Steele <[email protected]>
@mkrause mkrause closed this as completed May 11, 2020
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

4 participants