Closed malteneuss closed 9 months ago
Hello @malteneuss I would also expect the behaviour that you mention. Let me review it to understand what is going on under the hood.
Hello @malteneuss I'm really sorry for replying so late to you. I finally got some time to test the behavior that you mention and I was not able to replicate it. FWIW, I followed these steps to replicate it:
dotenv
to the deps of submodule
.submodule
module Main where
import Configuration.Dotenv
import System.Environment (getEnv)
main :: IO ()
main = do
loadFile defaultConfig
putStrLn "Running from submodule"
getEnv "FOO" >>= putStrLn
getEnv "BAR" >>= putStrLn
.env
file in module
and submodule
submodule
and executed it:I got these results:
camm@cristhian-pc ~/c/d/d/m/submodule (chore/test-issue-180)> cabal exec submodule
Resolving dependencies...
Running from submodule
submodule
submodule
FWIW, I created this branch with the test example: https://github.com/stackbuilders/dotenv-hs/tree/chore/test-issue-180/dotenv-test-180/module
Therefore, I'm not sure if there is actually a dotenv issue here.
Please, take a look at it and let me know if you have any comments. Thanks in advance!
Hello @malteneuss Please, let me know if the way I tested this was the same as yours. Otherwise, this may not be an issue in dotenv and we can close this issue.
I'll close this issue now. Feel free to reopen if the problem persists.
I'm using
dotenv
in a subproject of a monorepo setup with the following folder structure:When i start the subproject from the subproject folder like
i would expect for the subrproject
.env
file to be loaded, because this is in the current working directory. However, i noticed that the repository root.env
is loaded instead. Is that expected behavior? If yes, i could add an entry to the documentation.