freckle-app-1.8.1.0: Haskell application toolkit used at Freckle
Safe HaskellSafe-Inferred
LanguageHaskell2010

Freckle.App.Dotenv

Description

Conventional .env handling

Synopsis

Documentation

load :: IO () Source #

Call loadFile with .env

loadTest :: IO () Source #

Call loadFile with .env.test

loadFile :: FilePath -> IO () Source #

An opinionated loadFile

Additional behaviors:

  1. 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.

  1. 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!).

  1. Use the .env.example feature, but only if one exists alongside