I’m using the envfile
Noe module and am seeing it interpret comment lines. If my .env file contains something like this:
# This is a comment with = in the middle
PARAM1=VALUE1
then calling envfile2json
ends up creating this JSON object:
{"# This is a comment with":"in the middle","PARAM1":"VALUE1"}
This seems to be because the comment has the ‘=’ character in it. I wouldn’t expect a parse of a .env file to interpret a comment as an env defining line.
Other libraries and languages just ignore comments, but I’m not sure how envfile
could ignore a comment and maintain round-tripping (so .env to json to .env). Maybe using the “//” convention so that the .env file above would produce {"//":"# This is a comment with = in the middle","PARAM1":"VALUE1"}
, but even then if I’m using envfile
to get the env definitions to use them in something else, then I still end up with an interpretation of a comment.