godotenv: Doesn't support multiline vars
If I set something like this:
KEY='this is
a multiline
variable'
godotenv returns:
Can't separate key from value
Even though that’s a valid variable assignment.
I’m currently at work; will attempt a fix later this week.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 16
- Comments: 15 (7 by maintainers)
Commits related to this issue
- Base64 encode the ssh private key This is to get around https://github.com/joho/godotenv/issues/64 — committed to flanksource/karina by paddatrapper 3 years ago
Any updates on this? I am still having issues with the following env var:
I am still getting
Failed to setup application - cannot continue: Can't separate key from value@inoda You can probably just remove the actual line breaks (keeping the
\n) and it should work.I’ve received no complaints or bug reports about the pre-release, so I shall act as though absence of evidence is evidence of absence.
Pushing actual release today.
Pre-release at https://github.com/joho/godotenv/releases/tag/v1.5.0-beta.0
This is now fixed via #156 (which was an expansion of #118)
Thanks @x1unix for the bulk of the work, and @austinsasko and @coolaj86 for some key suggestions.
Sorry it took so long… go’s no longer my daily driver, startup life, parent life, and frankly i’ve always been bad at “chores”
Release plan is to let it sit on main for a while, see if anyone raises regressions. I might do a prerelease version number, might not. Then will release as a minor version bump.
While most of the discussion on this is happening in #65 I’d rather talk about it here in case the ultimate solution is a different PR.
Given I use the ruby dotenv implementation as the informal spec a solution should follow the form of https://github.com/bkeepers/dotenv/commit/b3bd6357f80981941d78e51fe86aeaf66cdcc60f and expand newlines within double quotes only.