Follow-up Comment #4, bug #62595 (project make):

No, no, that's not something one should expect from a .env file.

I said that _some_ dotenv parsers take it a step further to do all that fancy
interpolation, but really .env files are just files containing a bunch of
key=value lines, no functions or shell parsing necessary. It's just a
configuration file. Variable interpolation is a nice-to-have feature of most
dotenv parsers, not a requirement.


Unfortulately I don't think there is a definite spec I can point to, but I
found this one which explains the format
<>. And another one which
talks about the origin

To bring this back on topic, I believe "make" already has the capacity to do
what most dotenv parsers are doing. As you can see from the stackexchange page
<> I
linked earlier, make can already read some simple .env files when included
using the "include" directive, but for others it just needs to be guided a
little. For example:


should be translated into

export TEST_VAR := 8X46Yj*aek3GQeiW7\#bK!Eg@\#6vjV

And something like:


is to be translated to

export EMAIL := $(USER)

So the goal is not to write a parser, but more of a translator that converts
.env syntax to make syntax.

This feature can be exposed either via a directive within a Makefile
(includeenv) or a flag (--envfile) to make.


Reply to this item at:


Message sent via Savannah

Reply via email to