Open yossarian21 opened 1 month ago
This is an annoying consequence of the way that the various dotenv settings work.
Setting any dotenv-
setting turns on dotenv loading, which uses both dotenv-filename
and dotenv-path
. dotenv-filename
defaults to .env
, so even if you set dotenv-path
, just
will still also try to use dotenv-filename
to load an environment file.
So, even though you set dotenv-path := "."
, dotenv-filename
still has the default value of .env
, and the environment file in the parent directory is loaded.
This is definitely not ideal behavior, and if I could go back in time, I would definitely make dotenv-filenmae
and dotenv-path
not have default values, which would enable you to get the behavior you want.
Part of the reason that these settings are weird and continue to be weird is that someone could be relying on the existing behavior, and so changing them to be less weird might break someone's setup.
Probably the best way to fix this would be to introduce a new setting (sigh) which if used would provide better behavior.
I'm using just@1.31.0 on Mac.
The documentation states:
I tried configuring my justfile as follows:
There is no
.env
file in the current directory, but in the parent directory, I created a bogus.env
file, e.g.In the current directory with my
justfile
, I get this error:Expectation:
dotenv-path
should only load a.env
file from the specified path.