Skip to contents

Loads environment variables from a .env file if one exists. Called by read_config() before the configuration is resolved, so that the !expr Sys.getenv(...) entries in inst/config.yml see the local secrets.

Usage

load_dotenv(file = ".env")

Arguments

file

Path to the .env file. Defaults to .env in the working directory.

Value

NULL, invisibly. Called for its side effect.

Details

In CI the variables come from the workflow environment and no .env file is present, so this is a no-op there. Values already set in the environment win: dotenv::load_dot_env() does not overwrite them.