Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Conventional .env
handling
Documentation
loadFile :: FilePath -> IO () Source #
An opinionated loadFile
Additional behaviors:
- Attempt to locate the file in parent directories too
We, sadly, have a monorepository. So we need to locate a .env
file in
parent directories when running tests in sub-directories.
- Silently ignore no file found
Since this is used by withApp
, which we aim to use in
every non-trivial project, we can't fail in projects that don't need or
have a .env(.test)
file (such as this one!).
- Use the
.env.example
feature, but only if one exists alongside