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

Empty env var are not allowed anymore #26

Closed
goenning opened this issue Mar 21, 2017 · 2 comments · Fixed by #27
Closed

Empty env var are not allowed anymore #26

goenning opened this issue Mar 21, 2017 · 2 comments · Fixed by #27

Comments

@goenning
Copy link

Before PR #25 it was possible to have empty variables like

MYVAR=somevalue
MYOTHERVAR=

As of current version I'm receiving a panic with panic: runtime error: slice bounds out of range. Is this by design? I like to leave empty variables as placeholders and to let others know which variables can be used.

I can send the PR if necessary.

Thanks!

@joho
Copy link
Owner

joho commented Mar 21, 2017

I think at this stage either implementation is an accident on my part. I generally like to ensure the .env files are cross language compatible (ie could drop into a rails or php app) so let me check upstream for whether they're supported or not and we'll do whatever that is.

@joho
Copy link
Owner

joho commented Mar 21, 2017

Just tested a .env against the rubygem

FOO=BAR
BAZ=
BUM=POO

and got "FOO"=>"BAR", "BAZ"=>"", "BUM"=>"POO"

I also checked https://github.com/bkeepers/dotenv/blob/master/spec/dotenv/parser_spec.rb and it appears this is unspecified behaviour.

I'm happy to take a PR bringing support back, and then I might see if I can get that behaviour specified upstream.

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 a pull request may close this issue.

2 participants